Define Media root and URL for uploaded/generated files

This commit is contained in:
Adam Goldsmith 2024-03-08 15:26:31 -05:00
parent 9c1771b414
commit 97502fe130
3 changed files with 6 additions and 0 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ __pycache__/
*.sqlite3
/__pypackages__/
/markdownx/
/media/

View File

@ -118,6 +118,9 @@ LOGGING = {
},
}
MEDIA_ROOT = "media"
MEDIA_URL = "media/"
WIKI_URL = "https://wiki.claremontmakerspace.org"
# Django Rest Framework

View File

@ -15,6 +15,7 @@ Including another URLconf
"""
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import include, path
@ -63,3 +64,4 @@ urlpatterns = [
if settings.DEBUG:
urlpatterns.append(path("__debug__/", include("debug_toolbar.urls")))
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)