Skip to content

Commit

Permalink
Configure MEDIA_ settings for uploads
Browse files Browse the repository at this point in the history
This ensures that all uploads (e.g. documents and logos) are separate
from code, regardless of `upload_to` attributes on FileFields. This
also allows a single volume to be mounted for all uploads that won't
also contain other project files.
  • Loading branch information
friedelwolff committed Apr 18, 2024
1 parent ed2354d commit 8feb1c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ env.bak/
venv.bak/
app/static_files/
/app/documents/
app/media/
5 changes: 5 additions & 0 deletions app/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@

USE_TZ = True

# Media files (uploads)

MEDIA_ROOT = BASE_DIR / "media"
MEDIA_URL = "media/"

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/

Expand Down

0 comments on commit 8feb1c1

Please sign in to comment.