feat: Setup media

This commit is contained in:
Tom Hubrecht 2024-09-24 14:28:24 +02:00
parent 1dc8305027
commit abdcb2c8ad
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc
2 changed files with 9 additions and 4 deletions

View file

@ -165,6 +165,7 @@ USE_TZ = True
# -> https://docs.djangoproject.com/en/4.2/howto/static-files/
STATIC_URL = "static/"
MEDIA_URL = "media/"
STATICFILES_DIRS = [BASE_DIR / "shared" / "static"]
STATICFILES_FINDERS = [

View file

@ -28,7 +28,11 @@ urlpatterns = [
]
if settings.DEBUG:
urlpatterns += [
urlpatterns += (
[
path("__reload__/", include("django_browser_reload.urls")),
path("__debug__/", include("debug_toolbar.urls")),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
]
+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
)