Merge pull request #19 from makes-hacks-hip/redesign

serve media
This commit is contained in:
Thomas Irgang 2023-04-21 19:12:19 +02:00 committed by GitHub
commit 39100ce3c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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/pip_cache
RUN mkdir -p /opt/app/rc_hip RUN mkdir -p /opt/app/rc_hip
RUN mkdir -p /opt/app/rc_hip/data 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 COPY rc_hip /opt/app/rc_hip
RUN rm -f /opt/app/rc_hip/data/db.sqlite3 RUN rm -f /opt/app/rc_hip/data/db.sqlite3

View file

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

View file

@ -132,6 +132,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/4.2/howto/static-files/ # https://docs.djangoproject.com/en/4.2/howto/static-files/
STATIC_URL = 'static/' STATIC_URL = 'static/'
MEDIA_URL = 'media/'
# Default primary key field type # Default primary key field type
# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field # 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.contrib import admin
from django.urls import path, include from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [ urlpatterns = [
path("", include("repapp.urls")), path("", include("repapp.urls")),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
] ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)