mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Location of static files is also configurable
This commit is contained in:
parent
194c15492f
commit
ee223e5649
@ -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/'
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user