diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index 85043efd4d..5f7b868dc3 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -53,7 +53,7 @@ if cors_opt: CORS_ORIGIN_ALLOW_ALL = cors_opt.get('allow_all', False) if CORS_ORIGIN_ALLOW_ALL: - print("Warning: DEBUG mode is enabled, CORS requests are allowed for any domain") + print("Warning: CORS requests are allowed for any domain!") else: CORS_ORIGIN_WHITELIST = cors_opt.get('whitelist', []) @@ -106,7 +106,6 @@ LOGGING = { }, } - MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', @@ -158,7 +157,7 @@ DATABASES = {} if 'database' in CONFIG: DATABASES['default'] = CONFIG['database'] else: - print("Warning: Database backend not specified - using default") + print("Warning: Database backend not specified - using default (sqlite)") DATABASES['default'] = { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'inventree_db.sqlite3'), @@ -216,7 +215,7 @@ USE_TZ = True STATIC_URL = '/static/' STATICFILES_DIRS = [ - os.path.join(BASE_DIR, 'static'), + CONFIG.get('static_root', os.path.join(BASE_DIR, 'static')), ] MEDIA_URL = '/media/' diff --git a/InvenTree/config.yaml b/InvenTree/config.yaml index 9e204ed563..5aa24a3e69 100644 --- a/InvenTree/config.yaml +++ b/InvenTree/config.yaml @@ -25,8 +25,8 @@ allowed_hosts: # Cross Origin Resource Sharing (CORS) settings (see https://github.com/ottoyiu/django-cors-headers) # Following parameters are cors: - # CORS_ORIGIN_ALLOW_ALL - If True, the whitelist will not be used and all origins will be accepted. Defaults to False. - allow_all: False + # CORS_ORIGIN_ALLOW_ALL - If True, the whitelist will not be used and all origins will be accepted. + allow_all: True # CORS_ORIGIN_WHITELIST - A list of origins that are authorized to make cross-site HTTP requests. Defaults to [] # whitelist: @@ -38,5 +38,9 @@ cors: # This should be changed for a production installation media_root: './media' +# STATIC_ROOT is the local filesystem location for storing static files +# By default it is stored in a directory named 'static' local to the InvenTree directory +static_root: './static' + # Logging options log_queries: False \ No newline at end of file