MEDIA_ROOT is now provided in config.yaml

This commit is contained in:
Oliver Walters 2019-07-10 23:41:33 +10:00
parent e231de6951
commit 194c15492f
3 changed files with 11 additions and 1 deletions

View File

@ -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'

View File

@ -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

View File

@ -43,3 +43,8 @@ For further information, refer to the following documentation:
* `Django ALLOWED_HOSTS <https://docs.djangoproject.com/en/2.2/ref/settings/#allowed-hosts>`_
* `Django CORS headers <https://github.com/OttoYiu/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.