Skip to content

Commit

Permalink
Allow overriding default media directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Bogatay committed Aug 23, 2016
1 parent a1cd05f commit 6436e02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions paperless.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,5 @@ PAPERLESS_SHARED_SECRET=""
# the default location
#PAPERLESS_DBDIR=/path/to/database/file

# Override the default MEDIA_ROOT here. This is where all files are stored.
#PAPERLESS_MEDIADIR=/path/to/media
5 changes: 4 additions & 1 deletion src/paperless/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@
# https://docs.djangoproject.com/en/1.9/howto/static-files/

STATIC_ROOT = os.path.join(BASE_DIR, "..", "static")
MEDIA_ROOT = os.path.join(BASE_DIR, "..", "media")
MEDIA_ROOT = os.getenv(
"PAPERLESS_MEDIADIR",
os.path.join(BASE_DIR, "..", "media")
)

STATIC_URL = '/static/'
MEDIA_URL = "/media/"
Expand Down

0 comments on commit 6436e02

Please sign in to comment.