serve media

This commit is contained in:
Tom Irgang 2023-04-21 19:09:48 +02:00
parent 9c69dba56d
commit 034fb6c678
4 changed files with 8 additions and 1 deletions

View file

@ -11,6 +11,8 @@ RUN mkdir -p /opt/app
RUN mkdir -p /opt/app/pip_cache
RUN mkdir -p /opt/app/rc_hip
RUN mkdir -p /opt/app/rc_hip/data
RUN mkdir -p /opt/app/rc_hip/media
RUN mkdir -p /opt/app/rc_hip/static
COPY rc_hip /opt/app/rc_hip
RUN rm -f /opt/app/rc_hip/data/db.sqlite3

View file

@ -2,6 +2,8 @@ server {
listen 8020;
server_name example.org;
client_max_body_size 20M;
location / {
proxy_pass http://127.0.0.1:8010;
proxy_set_header Host $host;

View file

@ -132,6 +132,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/4.2/howto/static-files/
STATIC_URL = 'static/'
MEDIA_URL = 'media/'
# Default primary key field type
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field

View file

@ -16,9 +16,11 @@ Including another URLconf
"""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path("", include("repapp.urls")),
path('admin/', admin.site.urls),
]
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)