From 4adab092145049e27fbd43fbb55fd8453135fdd4 Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 16:48:37 +1000 Subject: [PATCH] Simplified configuration and corrected debug_toolbar induced problem --- mayan/settings/development.py | 27 +++++++++++++- mayan/settings/includes/common.py | 62 ++++++------------------------- mayan/settings/production.py | 8 ++++ 3 files changed, 45 insertions(+), 52 deletions(-) create mode 100644 mayan/settings/production.py diff --git a/mayan/settings/development.py b/mayan/settings/development.py index dcf833076f..e6457609f6 100644 --- a/mayan/settings/development.py +++ b/mayan/settings/development.py @@ -1 +1,26 @@ -from .includes.common import * \ No newline at end of file +from .includes.common import * + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ALLOWED_HOSTS = ['*'] + +INTERNAL_IPS = ('127.0.0.1',) + +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader') + +INSTALLED_APPS += ( + 'rosetta', + 'django_extensions', + 'debug_toolbar') + +# Stop debug toolbar patching! (see https://github.com/django-debug-toolbar/django-debug-toolbar/issues/524) +DEBUG_TOOLBAR_PATCH_SETTINGS = False + +TEMPLATE_CONTEXT_PROCESSORS += ('django.core.context_processors.debug',) + +WSGI_AUTO_RELOAD = True + +MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',) \ No newline at end of file diff --git a/mayan/settings/includes/common.py b/mayan/settings/includes/common.py index 4e69ec92f9..8f1be98249 100644 --- a/mayan/settings/includes/common.py +++ b/mayan/settings/includes/common.py @@ -42,7 +42,7 @@ ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = ( -#Django + #Django 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', @@ -52,16 +52,16 @@ INSTALLED_APPS = ( 'django.contrib.admindocs', 'django.contrib.comments', 'django.contrib.staticfiles', -# 3rd party -# South + # 3rd party + # South 'south', -# Others + # Others 'filetransfers', 'taggit', 'mptt', 'compressor', 'rest_framework', -# Base generic + # Base generic 'permissions', 'project_setup', 'project_tools', @@ -69,8 +69,8 @@ INSTALLED_APPS = ( 'navigation', 'lock_manager', 'web_theme', -# pagination needs to go after web_theme so that the pagination template -# if found + # pagination needs to go after web_theme so that the pagination template + # if found 'pagination', 'common', 'django_gpg', @@ -82,7 +82,7 @@ INSTALLED_APPS = ( 'scheduler', 'job_processor', 'installation', -# Mayan EDMS + # Mayan EDMS 'storage', 'app_registry', 'folders', @@ -103,9 +103,8 @@ INSTALLED_APPS = ( 'checkouts', 'bootstrap', 'registration', -# Has to be last so the other apps can register it's signals - 'signaler', -) + # Has to be last so the other apps can register it's signals + 'signaler') MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', @@ -266,43 +265,4 @@ REST_FRAMEWORK = { 'PAGINATE_BY': 10, 'PAGINATE_BY_PARAM': 'page_size', 'MAX_PAGINATE_BY': 100, -} - -try: - from settings_local import * -except ImportError: - pass - -if DEBUG: - INTERNAL_IPS = ('127.0.0.1',) - - TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', - ) - try: - import rosetta - INSTALLED_APPS += ('rosetta',) - except ImportError: - pass - - try: - import django_extensions - INSTALLED_APPS += ('django_extensions',) - except ImportError: - pass - - try: - import debug_toolbar - #INSTALLED_APPS +=('debug_toolbar',) - except ImportError: - pass - - TEMPLATE_CONTEXT_PROCESSORS += ('django.core.context_processors.debug',) - - WSGI_AUTO_RELOAD = True - if 'debug_toolbar' in INSTALLED_APPS: - MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',) - DEBUG_TOOLBAR_CONFIG = { - 'INTERCEPT_REDIRECTS': False, - } +} \ No newline at end of file diff --git a/mayan/settings/production.py b/mayan/settings/production.py new file mode 100644 index 0000000000..e5f50a7de3 --- /dev/null +++ b/mayan/settings/production.py @@ -0,0 +1,8 @@ +from .includes.common import * + +from .includes.common import * + +DEBUG = False +TEMPLATE_DEBUG = DEBUG + +ALLOWED_HOSTS = ['.crossculturalconsult.com'] \ No newline at end of file