From 194c15492f94a6fe661c6530723413fb4f9e536b Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 10 Jul 2019 23:41:33 +1000 Subject: [PATCH] MEDIA_ROOT is now provided in config.yaml --- InvenTree/InvenTree/settings.py | 2 +- InvenTree/config.yaml | 5 +++++ docs/config.rst | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index ab1095560a..85043efd4d 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -221,7 +221,7 @@ STATICFILES_DIRS = [ MEDIA_URL = '/media/' -MEDIA_ROOT = os.path.join(BASE_DIR, 'media') +MEDIA_ROOT = CONFIG.get('media_root', os.path.join(BASE_DIR, 'media')) # crispy forms use the bootstrap templates CRISPY_TEMPLATE_PACK = 'bootstrap' diff --git a/InvenTree/config.yaml b/InvenTree/config.yaml index 7f28aa4e5c..9e204ed563 100644 --- a/InvenTree/config.yaml +++ b/InvenTree/config.yaml @@ -33,5 +33,10 @@ cors: # - https://example.com # - https://sub.example.com +# MEDIA_ROOT is the local filesystem location for storing uploaded files +# By default, it is stored in a directory named 'media' local to the InvenTree directory +# This should be changed for a production installation +media_root: './media' + # Logging options log_queries: False \ No newline at end of file diff --git a/docs/config.rst b/docs/config.rst index 737798502e..d8388ae155 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -43,3 +43,8 @@ For further information, refer to the following documentation: * `Django ALLOWED_HOSTS `_ * `Django CORS headers `_ + +Uploaded File Storage +--------------------- + +By default, uploaded files are stored in the local direction ``./media``. This directory should be changed based on the particular installation requirements. \ No newline at end of file