Improve the settings method, allow for execution of mayan-edms.py without an existing local.py file
This commit is contained in:
@@ -16,6 +16,7 @@ class Command(management.BaseCommand):
|
|||||||
with open(os.path.join(settings.BASE_DIR, 'mayan', 'settings', 'local.py'), 'w+') as file_object:
|
with open(os.path.join(settings.BASE_DIR, 'mayan', 'settings', 'local.py'), 'w+') as file_object:
|
||||||
file_object.write('\n'.join([
|
file_object.write('\n'.join([
|
||||||
'from __future__ import absolute_import',
|
'from __future__ import absolute_import',
|
||||||
|
'',
|
||||||
'from .base import *',
|
'from .base import *',
|
||||||
'',
|
'',
|
||||||
"SECRET_KEY = '{0}'".format(self._generate_secret_key()),
|
"SECRET_KEY = '{0}'".format(self._generate_secret_key()),
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mayan.settings.local")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mayan.settings")
|
||||||
|
|
||||||
from django.core.management import execute_from_command_line
|
from django.core.management import execute_from_command_line
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from .base import *
|
try:
|
||||||
|
from .local import * # NOQA
|
||||||
|
except ImportError:
|
||||||
|
from .base import * # NOQA
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ ALLOWED_HOSTS = []
|
|||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = (
|
||||||
#Django
|
# Django
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
'django.contrib.admindocs',
|
'django.contrib.admindocs',
|
||||||
'django.contrib.auth',
|
'django.contrib.auth',
|
||||||
@@ -204,7 +204,8 @@ STATICFILES_FINDERS = (
|
|||||||
|
|
||||||
# --------- Django compressor -------------
|
# --------- Django compressor -------------
|
||||||
COMPRESS_PARSER = 'compressor.parser.HtmlParser'
|
COMPRESS_PARSER = 'compressor.parser.HtmlParser'
|
||||||
COMPRESS_CSS_FILTERS = ['compressor.filters.css_default.CssAbsoluteFilter', 'compressor.filters.cssmin.CSSMinFilter']
|
COMPRESS_CSS_FILTERS = ['compressor.filters.css_default.CssAbsoluteFilter',
|
||||||
|
'compressor.filters.cssmin.CSSMinFilter']
|
||||||
COMPRESS_ENABLED = False
|
COMPRESS_ENABLED = False
|
||||||
# ---------- Django sendfile --------------
|
# ---------- Django sendfile --------------
|
||||||
SENDFILE_BACKEND = 'sendfile.backends.simple'
|
SENDFILE_BACKEND = 'sendfile.backends.simple'
|
||||||
@@ -261,5 +262,5 @@ REST_FRAMEWORK = {
|
|||||||
CELERY_TIMEZONE = 'UTC'
|
CELERY_TIMEZONE = 'UTC'
|
||||||
CELERY_ENABLE_UTC = True
|
CELERY_ENABLE_UTC = True
|
||||||
CELERY_ALWAYS_EAGER = True
|
CELERY_ALWAYS_EAGER = True
|
||||||
#------------ CORS ------------
|
# ------------ CORS ------------
|
||||||
CORS_ORIGIN_ALLOW_ALL = True
|
CORS_ORIGIN_ALLOW_ALL = True
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from .base import *
|
from . import * # NOQA
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
TEMPLATE_DEBUG = DEBUG
|
TEMPLATE_DEBUG = DEBUG
|
||||||
@@ -19,7 +19,8 @@ INSTALLED_APPS += (
|
|||||||
'django_extensions',
|
'django_extensions',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Stop debug toolbar patching! (see https://github.com/django-debug-toolbar/django-debug-toolbar/issues/524)
|
# Stop debug toolbar patching!
|
||||||
|
# see https://github.com/django-debug-toolbar/django-debug-toolbar/issues/524
|
||||||
TEMPLATE_CONTEXT_PROCESSORS += ('django.core.context_processors.debug',)
|
TEMPLATE_CONTEXT_PROCESSORS += ('django.core.context_processors.debug',)
|
||||||
|
|
||||||
WSGI_AUTO_RELOAD = True
|
WSGI_AUTO_RELOAD = True
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
from .base import *
|
from . import * # NOQA
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
TEMPLATE_DEBUG = DEBUG
|
TEMPLATE_DEBUG = DEBUG
|
||||||
@@ -20,7 +20,8 @@ INSTALLED_APPS += (
|
|||||||
'debug_toolbar'
|
'debug_toolbar'
|
||||||
)
|
)
|
||||||
|
|
||||||
# Stop debug toolbar patching! (see https://github.com/django-debug-toolbar/django-debug-toolbar/issues/524)
|
# Stop debug toolbar patching!
|
||||||
|
# see https://github.com/django-debug-toolbar/django-debug-toolbar/issues/524
|
||||||
DEBUG_TOOLBAR_PATCH_SETTINGS = False
|
DEBUG_TOOLBAR_PATCH_SETTINGS = False
|
||||||
|
|
||||||
TEMPLATE_CONTEXT_PROCESSORS += ('django.core.context_processors.debug',)
|
TEMPLATE_CONTEXT_PROCESSORS += ('django.core.context_processors.debug',)
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
from .local import *
|
|
||||||
|
from . import * # NOQA
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
ALLOWED_HOSTS = ['*'] # Update this accordingly; https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
|
|
||||||
|
# Update this accordingly;
|
||||||
|
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
|
||||||
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|||||||
Reference in New Issue
Block a user