From 7508ceaa2479c8769de3908178c479145919e8aa Mon Sep 17 00:00:00 2001 From: pwhipp Date: Wed, 9 Jul 2014 07:11:24 +1000 Subject: [PATCH 01/17] Ignored .idea IDE local development files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 36d4adbe97..31834384e5 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ gpg_home/ /venv/ .coverage /dist/ +.idea/ *egg-info* From 2f423a894a78d491d6eb183aeb71b48efbb0a87f Mon Sep 17 00:00:00 2001 From: pwhipp Date: Wed, 9 Jul 2014 07:17:04 +1000 Subject: [PATCH 02/17] Changed to use postgres 'mayan' database and user. --- mayan/settings.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mayan/settings.py b/mayan/settings.py index ab42632178..5862fa08d2 100644 --- a/mayan/settings.py +++ b/mayan/settings.py @@ -122,10 +122,12 @@ WSGI_APPLICATION = 'mayan.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(SITE_ROOT, 'db.sqlite3'), - } -} + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'mayan', + 'USER': 'mayan', + 'PASSWORD': 'Jeeji4ah', + 'HOST': '', + 'PORT': ''}} # Internationalization # https://docs.djangoproject.com/en/1.6/topics/i18n/ From 6a863ee5e5d80635fc744aa5d6d482f4dab923fc Mon Sep 17 00:00:00 2001 From: pwhipp Date: Wed, 9 Jul 2014 07:32:59 +1000 Subject: [PATCH 03/17] Refactored settings to support multiple sites and secrets --- mayan/settings/__init__.py | 1 + mayan/settings/dev.py | 15 ++++++++ mayan/settings/includes/.gitignore | 1 + mayan/settings/includes/__init__.py | 1 + .../includes/common.py} | 35 ++++++------------- 5 files changed, 29 insertions(+), 24 deletions(-) create mode 100644 mayan/settings/__init__.py create mode 100644 mayan/settings/dev.py create mode 100644 mayan/settings/includes/.gitignore create mode 100644 mayan/settings/includes/__init__.py rename mayan/{settings.py => settings/includes/common.py} (90%) diff --git a/mayan/settings/__init__.py b/mayan/settings/__init__.py new file mode 100644 index 0000000000..62bff48960 --- /dev/null +++ b/mayan/settings/__init__.py @@ -0,0 +1 @@ +__author__ = 'paul' diff --git a/mayan/settings/dev.py b/mayan/settings/dev.py new file mode 100644 index 0000000000..03ecf595f6 --- /dev/null +++ b/mayan/settings/dev.py @@ -0,0 +1,15 @@ +from mayan.settings.includes.common import * + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ALLOWED_HOSTS = [] + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'mayan', + 'USER': 'mayan', + 'PASSWORD': DBPASSWORD, + 'HOST': '', + 'PORT': ''}} \ No newline at end of file diff --git a/mayan/settings/includes/.gitignore b/mayan/settings/includes/.gitignore new file mode 100644 index 0000000000..c6b649876c --- /dev/null +++ b/mayan/settings/includes/.gitignore @@ -0,0 +1 @@ +secrets.py \ No newline at end of file diff --git a/mayan/settings/includes/__init__.py b/mayan/settings/includes/__init__.py new file mode 100644 index 0000000000..62bff48960 --- /dev/null +++ b/mayan/settings/includes/__init__.py @@ -0,0 +1 @@ +__author__ = 'paul' diff --git a/mayan/settings.py b/mayan/settings/includes/common.py similarity index 90% rename from mayan/settings.py rename to mayan/settings/includes/common.py index 5862fa08d2..d34630afde 100644 --- a/mayan/settings.py +++ b/mayan/settings/includes/common.py @@ -11,25 +11,22 @@ https://docs.djangoproject.com/en/1.6/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os +from django.core.exceptions import ImproperlyConfigured + + ugettext = lambda s: s BASE_DIR = os.path.abspath(os.path.dirname(__file__)) -SITE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) +SITE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../..//')) +try: + from .secrets import * +except ImportError: + raise ImproperlyConfigured('You need a secrets.py file - contact aaron.dennis@crossculturalconsult.com') -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'om^a(i8^6&h+umbd2%pt91cj!qu_@oztw117rgxmn(n2lp^*c!' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -TEMPLATE_DEBUG = True - -ALLOWED_HOSTS = [] +DEBUG = False +TEMPLATE_DEBUG = DEBUG # Application definition @@ -117,17 +114,7 @@ ROOT_URLCONF = 'mayan.urls' WSGI_APPLICATION = 'mayan.wsgi.application' -# Database -# https://docs.djangoproject.com/en/1.6/ref/settings/#databases -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'mayan', - 'USER': 'mayan', - 'PASSWORD': 'Jeeji4ah', - 'HOST': '', - 'PORT': ''}} # Internationalization # https://docs.djangoproject.com/en/1.6/topics/i18n/ @@ -154,7 +141,7 @@ import sys from django.core.urlresolvers import reverse_lazy -sys.path.append(os.path.join(BASE_DIR, 'apps')) +sys.path.append(os.path.join(BASE_DIR, '../../../apps')) PROJECT_TITLE = 'Mayan EDMS' PROJECT_NAME = 'mayan' From 23ed5b15a2e29fe77fe38176e551edf868013f95 Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 07:29:38 +1000 Subject: [PATCH 04/17] Reconfigured settings to support mayan/apps and separate production and development. --- .gitignore | 1 + mayan/settings/dev.py | 17 +++- mayan/settings/includes/common.py | 93 ++++++---------------- mayan/settings/includes/secrets.py.example | 3 + mayan/settings/production.py | 15 ++++ requirements/common.txt | 1 + requirements/development.txt | 1 + 7 files changed, 60 insertions(+), 71 deletions(-) create mode 100644 mayan/settings/includes/secrets.py.example create mode 100644 mayan/settings/production.py diff --git a/.gitignore b/.gitignore index 31834384e5..083534daf5 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,5 @@ gpg_home/ .coverage /dist/ .idea/ +static_collected/ *egg-info* diff --git a/mayan/settings/dev.py b/mayan/settings/dev.py index 03ecf595f6..bd6090bdff 100644 --- a/mayan/settings/dev.py +++ b/mayan/settings/dev.py @@ -3,6 +3,8 @@ from mayan.settings.includes.common import * DEBUG = True TEMPLATE_DEBUG = DEBUG +INTERNAL_IPS = ('127.0.0.1',) + ALLOWED_HOSTS = [] DATABASES = { @@ -12,4 +14,17 @@ DATABASES = { 'USER': 'mayan', 'PASSWORD': DBPASSWORD, 'HOST': '', - 'PORT': ''}} \ No newline at end of file + 'PORT': ''}} + +INSTALLED_APPS = INSTALLED_APPS + ( + 'rosetta', + 'django_extensions', + 'debug_toolbar') + + +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader') +TEMPLATE_CONTEXT_PROCESSORS += ('django.core.context_processors.debug',) +WSGI_AUTO_RELOAD = True +MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',) diff --git a/mayan/settings/includes/common.py b/mayan/settings/includes/common.py index 4590dbd180..a0f1fe5945 100644 --- a/mayan/settings/includes/common.py +++ b/mayan/settings/includes/common.py @@ -8,16 +8,22 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -import os from django.core.exceptions import ImproperlyConfigured ugettext = lambda s: s -BASE_DIR = os.path.abspath(os.path.dirname(__file__)) -SITE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../..//')) +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +import os +import sys + +BASE_DIR = '/'.join(os.path.abspath(os.path.dirname(__file__)).split('/')[0:-4]) # up from mayan/settings/include +SITE_ROOT = BASE_DIR # for compatibility +sys.path.append(os.path.join(BASE_DIR, 'mayan/apps')) + +STATIC_URL = '/static/' +STATIC_ROOT = os.path.join(BASE_DIR, 'static_collected/') try: from .secrets import * @@ -25,13 +31,12 @@ except ImportError: raise ImproperlyConfigured('You need a secrets.py file - contact aaron.dennis@crossculturalconsult.com') DEBUG = False - TEMPLATE_DEBUG = DEBUG # Application definition INSTALLED_APPS = ( -#Django + #Django 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', @@ -41,16 +46,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', @@ -58,8 +63,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', @@ -71,7 +76,7 @@ INSTALLED_APPS = ( 'scheduler', 'job_processor', 'installation', -# Mayan EDMS + # Mayan EDMS 'storage', 'app_registry', 'folders', @@ -92,9 +97,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', @@ -107,8 +111,7 @@ MIDDLEWARE_CLASSES = ( 'common.middleware.strip_spaces_widdleware.SpacelessMiddleware', 'common.middleware.login_required_middleware.LoginRequiredMiddleware', 'permissions.middleware.permission_denied_middleware.PermissionDeniedMiddleware', - 'pagination.middleware.PaginationMiddleware', -) + 'pagination.middleware.PaginationMiddleware') ROOT_URLCONF = 'mayan.urls' @@ -133,18 +136,10 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.6/howto/static-files/ -STATIC_URL = '/static/' - -# Custom settings section - -import sys from django.core.urlresolvers import reverse_lazy -sys.path.append(os.path.join(BASE_DIR, '../../../apps')) - -PROJECT_TITLE = 'Mayan EDMS' -PROJECT_NAME = 'mayan' +PROJECT_TITLE = 'Mayan CCCS Review' LANGUAGES = ( ('ar', ugettext('Arabic')), @@ -173,9 +168,6 @@ LANGUAGES = ( SITE_ID = 1 -STATIC_ROOT = os.path.join(SITE_ROOT, 'static/') - -STATIC_URL = '/%s-static/' % PROJECT_NAME ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' @@ -225,7 +217,7 @@ LOGIN_EXEMPT_URLS = ( r'^favicon\.ico$', r'^about\.html$', r'^legal/', # allow the entire /legal/* subsection - r'^%s-static/' % PROJECT_NAME, + r'^static/', r'^accounts/register/$', r'^accounts/register/complete/$', @@ -257,42 +249,3 @@ REST_FRAMEWORK = { '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, - } diff --git a/mayan/settings/includes/secrets.py.example b/mayan/settings/includes/secrets.py.example new file mode 100644 index 0000000000..d6e1bc581b --- /dev/null +++ b/mayan/settings/includes/secrets.py.example @@ -0,0 +1,3 @@ +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'not so secret so change me' +DBPASSWORD = 'my db user password' \ No newline at end of file diff --git a/mayan/settings/production.py b/mayan/settings/production.py new file mode 100644 index 0000000000..6f4a2fbd03 --- /dev/null +++ b/mayan/settings/production.py @@ -0,0 +1,15 @@ +from mayan.settings.includes.common import * + +DEBUG = False +TEMPLATE_DEBUG = DEBUG + +ALLOWED_HOSTS = ['.crossculturalconsult.com'] + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'mayan', + 'USER': 'mayan', + 'PASSWORD': DBPASSWORD, + 'HOST': '', + 'PORT': ''}} \ No newline at end of file diff --git a/requirements/common.txt b/requirements/common.txt index 9ab2e2b0bb..3bc0646631 100644 --- a/requirements/common.txt +++ b/requirements/common.txt @@ -32,3 +32,4 @@ South==0.8.4 unicode-slugify==0.1 wsgiref==0.1.2 +psycopg2==2.5.3 diff --git a/requirements/development.txt b/requirements/development.txt index 3433d95c6b..084871c086 100644 --- a/requirements/development.txt +++ b/requirements/development.txt @@ -5,3 +5,4 @@ django-extensions==1.3.8 django-rosetta==0.7.4 transifex-client==0.10 django-debug-toolbar==1.2.1 +ipython==2.1.0 From a14f8cb980f1745b8a3ba88bdd9ff040d20ddedf Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 15:14:53 +1000 Subject: [PATCH 05/17] Tidied common settings --- mayan/settings/includes/common.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mayan/settings/includes/common.py b/mayan/settings/includes/common.py index a0f1fe5945..ed70d069e8 100644 --- a/mayan/settings/includes/common.py +++ b/mayan/settings/includes/common.py @@ -1,6 +1,4 @@ """ -Django settings for testproject project. - For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ @@ -18,9 +16,12 @@ ugettext = lambda s: s import os import sys -BASE_DIR = '/'.join(os.path.abspath(os.path.dirname(__file__)).split('/')[0:-4]) # up from mayan/settings/include +BASE_DIR = '/'.join(os.path.abspath(os.path.dirname(__file__)).split('/')[0:-3]) # up from mayan/settings/include SITE_ROOT = BASE_DIR # for compatibility -sys.path.append(os.path.join(BASE_DIR, 'mayan/apps')) + +_apps_path = os.path.join(BASE_DIR, 'mayan/apps') +if _apps_path not in sys.path: + sys.path.append(_apps_path) STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static_collected/') From 0ef00b508243416d99815e9052ce459d6ab5f02e Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 15:59:03 +1000 Subject: [PATCH 06/17] Reverted to default (sqlite) settings so all working. --- .../includes/common.py => settings.py} | 121 +++++++++++++----- mayan/settings/__init__.py | 1 - mayan/settings/dev.py | 30 ----- mayan/settings/includes/.gitignore | 1 - mayan/settings/includes/__init__.py | 1 - mayan/settings/includes/secrets.py.example | 3 - mayan/settings/production.py | 15 --- 7 files changed, 89 insertions(+), 83 deletions(-) rename mayan/{settings/includes/common.py => settings.py} (73%) delete mode 100644 mayan/settings/__init__.py delete mode 100644 mayan/settings/dev.py delete mode 100644 mayan/settings/includes/.gitignore delete mode 100644 mayan/settings/includes/__init__.py delete mode 100644 mayan/settings/includes/secrets.py.example delete mode 100644 mayan/settings/production.py diff --git a/mayan/settings/includes/common.py b/mayan/settings.py similarity index 73% rename from mayan/settings/includes/common.py rename to mayan/settings.py index ed70d069e8..eb4a3386c1 100644 --- a/mayan/settings/includes/common.py +++ b/mayan/settings.py @@ -1,4 +1,6 @@ """ +Django settings for testproject project. + For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ @@ -6,38 +8,33 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ - -from django.core.exceptions import ImproperlyConfigured - +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +import os ugettext = lambda s: s -# Build paths inside the project like this: os.path.join(BASE_DIR, ...) -import os -import sys +BASE_DIR = os.path.abspath(os.path.dirname(__file__)) +SITE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) -BASE_DIR = '/'.join(os.path.abspath(os.path.dirname(__file__)).split('/')[0:-3]) # up from mayan/settings/include -SITE_ROOT = BASE_DIR # for compatibility -_apps_path = os.path.join(BASE_DIR, 'mayan/apps') -if _apps_path not in sys.path: - sys.path.append(_apps_path) +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ -STATIC_URL = '/static/' -STATIC_ROOT = os.path.join(BASE_DIR, 'static_collected/') +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'om^a(i8^6&h+umbd2%pt91cj!qu_@oztw117rgxmn(n2lp^*c!' -try: - from .secrets import * -except ImportError: - raise ImproperlyConfigured('You need a secrets.py file - contact aaron.dennis@crossculturalconsult.com') +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +TEMPLATE_DEBUG = True + +ALLOWED_HOSTS = [] -DEBUG = False -TEMPLATE_DEBUG = DEBUG # Application definition INSTALLED_APPS = ( - #Django +#Django 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', @@ -47,16 +44,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', @@ -64,8 +61,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', @@ -77,7 +74,7 @@ INSTALLED_APPS = ( 'scheduler', 'job_processor', 'installation', - # Mayan EDMS +# Mayan EDMS 'storage', 'app_registry', 'folders', @@ -98,8 +95,9 @@ 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', @@ -112,13 +110,22 @@ MIDDLEWARE_CLASSES = ( 'common.middleware.strip_spaces_widdleware.SpacelessMiddleware', 'common.middleware.login_required_middleware.LoginRequiredMiddleware', 'permissions.middleware.permission_denied_middleware.PermissionDeniedMiddleware', - 'pagination.middleware.PaginationMiddleware') + 'pagination.middleware.PaginationMiddleware', +) ROOT_URLCONF = 'mayan.urls' WSGI_APPLICATION = 'mayan.wsgi.application' +# Database +# https://docs.djangoproject.com/en/1.6/ref/settings/#databases +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(SITE_ROOT, 'db.sqlite3'), + } +} # Internationalization # https://docs.djangoproject.com/en/1.6/topics/i18n/ @@ -137,10 +144,18 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.6/howto/static-files/ +STATIC_URL = '/static/' + +# Custom settings section + +import sys from django.core.urlresolvers import reverse_lazy -PROJECT_TITLE = 'Mayan CCCS Review' +sys.path.append(os.path.join(BASE_DIR, 'apps')) + +PROJECT_TITLE = 'Mayan EDMS' +PROJECT_NAME = 'mayan' LANGUAGES = ( ('ar', ugettext('Arabic')), @@ -169,6 +184,9 @@ LANGUAGES = ( SITE_ID = 1 +STATIC_ROOT = os.path.join(SITE_ROOT, 'static/') + +STATIC_URL = '/%s-static/' % PROJECT_NAME ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' @@ -218,7 +236,7 @@ LOGIN_EXEMPT_URLS = ( r'^favicon\.ico$', r'^about\.html$', r'^legal/', # allow the entire /legal/* subsection - r'^static/', + r'^%s-static/' % PROJECT_NAME, r'^accounts/register/$', r'^accounts/register/complete/$', @@ -250,3 +268,42 @@ REST_FRAMEWORK = { '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, + } diff --git a/mayan/settings/__init__.py b/mayan/settings/__init__.py deleted file mode 100644 index 62bff48960..0000000000 --- a/mayan/settings/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'paul' diff --git a/mayan/settings/dev.py b/mayan/settings/dev.py deleted file mode 100644 index bd6090bdff..0000000000 --- a/mayan/settings/dev.py +++ /dev/null @@ -1,30 +0,0 @@ -from mayan.settings.includes.common import * - -DEBUG = True -TEMPLATE_DEBUG = DEBUG - -INTERNAL_IPS = ('127.0.0.1',) - -ALLOWED_HOSTS = [] - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'mayan', - 'USER': 'mayan', - 'PASSWORD': DBPASSWORD, - 'HOST': '', - 'PORT': ''}} - -INSTALLED_APPS = INSTALLED_APPS + ( - 'rosetta', - 'django_extensions', - 'debug_toolbar') - - -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader') -TEMPLATE_CONTEXT_PROCESSORS += ('django.core.context_processors.debug',) -WSGI_AUTO_RELOAD = True -MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',) diff --git a/mayan/settings/includes/.gitignore b/mayan/settings/includes/.gitignore deleted file mode 100644 index c6b649876c..0000000000 --- a/mayan/settings/includes/.gitignore +++ /dev/null @@ -1 +0,0 @@ -secrets.py \ No newline at end of file diff --git a/mayan/settings/includes/__init__.py b/mayan/settings/includes/__init__.py deleted file mode 100644 index 62bff48960..0000000000 --- a/mayan/settings/includes/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__author__ = 'paul' diff --git a/mayan/settings/includes/secrets.py.example b/mayan/settings/includes/secrets.py.example deleted file mode 100644 index d6e1bc581b..0000000000 --- a/mayan/settings/includes/secrets.py.example +++ /dev/null @@ -1,3 +0,0 @@ -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'not so secret so change me' -DBPASSWORD = 'my db user password' \ No newline at end of file diff --git a/mayan/settings/production.py b/mayan/settings/production.py deleted file mode 100644 index 6f4a2fbd03..0000000000 --- a/mayan/settings/production.py +++ /dev/null @@ -1,15 +0,0 @@ -from mayan.settings.includes.common import * - -DEBUG = False -TEMPLATE_DEBUG = DEBUG - -ALLOWED_HOSTS = ['.crossculturalconsult.com'] - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'mayan', - 'USER': 'mayan', - 'PASSWORD': DBPASSWORD, - 'HOST': '', - 'PORT': ''}} \ No newline at end of file From 4b30eb7ff977ea3ff56e3306cb6f089424758c05 Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 16:13:30 +1000 Subject: [PATCH 07/17] Moved original settings to be common includes. --- mayan/settings/__init__.py | 0 mayan/settings/includes/__init__.py | 0 mayan/{settings.py => settings/includes/common.py} | 5 +++-- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 mayan/settings/__init__.py create mode 100644 mayan/settings/includes/__init__.py rename mayan/{settings.py => settings/includes/common.py} (98%) diff --git a/mayan/settings/__init__.py b/mayan/settings/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/settings/includes/__init__.py b/mayan/settings/includes/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/settings.py b/mayan/settings/includes/common.py similarity index 98% rename from mayan/settings.py rename to mayan/settings/includes/common.py index eb4a3386c1..3bee2e108b 100644 --- a/mayan/settings.py +++ b/mayan/settings/includes/common.py @@ -13,8 +13,9 @@ import os ugettext = lambda s: s -BASE_DIR = os.path.abspath(os.path.dirname(__file__)) -SITE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) +_file_path = os.path.abspath(os.path.dirname(__file__)).split('/') +BASE_DIR = '/'.join(_file_path[0:-2]) +SITE_ROOT = '/'.join(_file_path[0:-3]) # Quick-start development settings - unsuitable for production From d7976375ec9f612f2c594c702d96f554a7db59cb Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 16:20:00 +1000 Subject: [PATCH 08/17] Tidied BASE_DIR/SITE_ROOT --- mayan/settings/includes/common.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/mayan/settings/includes/common.py b/mayan/settings/includes/common.py index 3bee2e108b..7ae1e39808 100644 --- a/mayan/settings/includes/common.py +++ b/mayan/settings/includes/common.py @@ -10,12 +10,17 @@ https://docs.djangoproject.com/en/1.6/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os +import sys ugettext = lambda s: s _file_path = os.path.abspath(os.path.dirname(__file__)).split('/') -BASE_DIR = '/'.join(_file_path[0:-2]) -SITE_ROOT = '/'.join(_file_path[0:-3]) +BASE_DIR = SITE_ROOT = '/'.join(_file_path[0:-3]) + +sys.path.append(os.path.join(BASE_DIR, 'mayan', 'apps')) + +STATIC_URL = '/static/' +STATIC_ROOT = os.path.join(BASE_DIR, 'static_collected') # Quick-start development settings - unsuitable for production @@ -124,7 +129,7 @@ WSGI_APPLICATION = 'mayan.wsgi.application' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(SITE_ROOT, 'db.sqlite3'), + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } @@ -142,18 +147,12 @@ USE_L10N = True USE_TZ = True -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.6/howto/static-files/ - -STATIC_URL = '/static/' # Custom settings section -import sys from django.core.urlresolvers import reverse_lazy -sys.path.append(os.path.join(BASE_DIR, 'apps')) PROJECT_TITLE = 'Mayan EDMS' PROJECT_NAME = 'mayan' @@ -185,9 +184,6 @@ LANGUAGES = ( SITE_ID = 1 -STATIC_ROOT = os.path.join(SITE_ROOT, 'static/') - -STATIC_URL = '/%s-static/' % PROJECT_NAME ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' From a05d92ceadd418304379fb92a0a71abb924ee424 Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 16:26:10 +1000 Subject: [PATCH 09/17] Added settings/includes/secrets.py facility for site specific secret data that should not be in the repo. --- mayan/settings/includes/common.py | 8 +++++--- mayan/settings/includes/secrets.py.example | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 mayan/settings/includes/secrets.py.example diff --git a/mayan/settings/includes/common.py b/mayan/settings/includes/common.py index 7ae1e39808..4e69ec92f9 100644 --- a/mayan/settings/includes/common.py +++ b/mayan/settings/includes/common.py @@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/1.6/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os import sys +from django.core.exceptions import ImproperlyConfigured ugettext = lambda s: s @@ -22,13 +23,14 @@ sys.path.append(os.path.join(BASE_DIR, 'mayan', 'apps')) STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static_collected') +try: + from .secrets import * +except ImportError: + raise ImproperlyConfigured('You need a secrets.py file - use secrets.py.example for development') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'om^a(i8^6&h+umbd2%pt91cj!qu_@oztw117rgxmn(n2lp^*c!' - # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True diff --git a/mayan/settings/includes/secrets.py.example b/mayan/settings/includes/secrets.py.example new file mode 100644 index 0000000000..285178747d --- /dev/null +++ b/mayan/settings/includes/secrets.py.example @@ -0,0 +1,2 @@ +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'Ei5lo4oh zooW4xaj ic6Uehaa Vahy2zae seej1OhK iwoh3ziX gai3Ohng Igh3phae' From 71e35f5746bd5276f186012ee57487924ecb0864 Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 16:28:12 +1000 Subject: [PATCH 10/17] Added settings/development.py --- mayan/settings/development.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 mayan/settings/development.py diff --git a/mayan/settings/development.py b/mayan/settings/development.py new file mode 100644 index 0000000000..dcf833076f --- /dev/null +++ b/mayan/settings/development.py @@ -0,0 +1 @@ +from .includes.common import * \ No newline at end of file From 4adab092145049e27fbd43fbb55fd8453135fdd4 Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 16:48:37 +1000 Subject: [PATCH 11/17] 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 From b9bf845964bba7bfee4b45d47b9c52cd7aee2761 Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 17:01:44 +1000 Subject: [PATCH 12/17] Added required postgres database configuration --- mayan/settings/includes/common.py | 10 ++++++---- mayan/settings/includes/secrets.py.example | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mayan/settings/includes/common.py b/mayan/settings/includes/common.py index 8f1be98249..d0e6c16f84 100644 --- a/mayan/settings/includes/common.py +++ b/mayan/settings/includes/common.py @@ -129,10 +129,12 @@ WSGI_APPLICATION = 'mayan.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} + 'ENGINE': 'django.db.backends.postgresql_psycopg2', + 'NAME': 'mayan', + 'USER': 'mayan', + 'PASSWORD': DBPASSWORD, + 'HOST': '', + 'PORT': ''}} # Internationalization # https://docs.djangoproject.com/en/1.6/topics/i18n/ diff --git a/mayan/settings/includes/secrets.py.example b/mayan/settings/includes/secrets.py.example index 285178747d..4bfcf67a72 100644 --- a/mayan/settings/includes/secrets.py.example +++ b/mayan/settings/includes/secrets.py.example @@ -1,2 +1,5 @@ +# Keep this restricted to just the stuff you really need to keep secret so that it does not need to change or +# be modified often. # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'Ei5lo4oh zooW4xaj ic6Uehaa Vahy2zae seej1OhK iwoh3ziX gai3Ohng Igh3phae' +DBPASSWORD = '' From 877ec04faf3fe9909409f4cf464118e145efb3fe Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 17:02:01 +1000 Subject: [PATCH 13/17] Added explicit debug toolbar setup --- mayan/urls.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mayan/urls.py b/mayan/urls.py index f984cf53e0..f34d3f1420 100644 --- a/mayan/urls.py +++ b/mayan/urls.py @@ -61,6 +61,12 @@ if settings.DEBUG: urlpatterns += staticfiles_urlpatterns() if 'rosetta' in settings.INSTALLED_APPS: - urlpatterns += patterns('', - url(r'^rosetta/', include('rosetta.urls'), name='rosetta'), - ) + urlpatterns += patterns( + '', + url(r'^rosetta/', include('rosetta.urls'), name='rosetta')) + + import debug_toolbar + urlpatterns += patterns( + '', + url(r'^__debug__/', include(debug_toolbar.urls))) + From a011098c2cf4c4afe0c8f7f71c580d4006fd2d8e Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 17:03:11 +1000 Subject: [PATCH 14/17] Added .gitignore so that secrets.py never gets added into the repo by accident. --- mayan/settings/includes/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 mayan/settings/includes/.gitignore diff --git a/mayan/settings/includes/.gitignore b/mayan/settings/includes/.gitignore new file mode 100644 index 0000000000..c6b649876c --- /dev/null +++ b/mayan/settings/includes/.gitignore @@ -0,0 +1 @@ +secrets.py \ No newline at end of file From af7effb9cb6a6e98b0aaedc53dfc8d7f07e3959e Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 17:42:07 +1000 Subject: [PATCH 15/17] Added deployment information for production site --- deploy/gunicorn.conf.py | 31 +++++++++++++++++++++++++++ deploy/production/nginx.conf | 34 ++++++++++++++++++++++++++++++ deploy/production/service_demon.sh | 10 +++++++++ deploy/production/upstart.conf | 10 +++++++++ mayan/settings/production.py | 14 +++++++++++- 5 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 deploy/gunicorn.conf.py create mode 100644 deploy/production/nginx.conf create mode 100755 deploy/production/service_demon.sh create mode 100644 deploy/production/upstart.conf diff --git a/deploy/gunicorn.conf.py b/deploy/gunicorn.conf.py new file mode 100644 index 0000000000..7e3916f474 --- /dev/null +++ b/deploy/gunicorn.conf.py @@ -0,0 +1,31 @@ +# invoke gunicorn using +# 'gunicorn -c .wsgi:application +import os +import multiprocessing + +from django.conf import settings + +bind = settings.GUNICORN_BIND +workers = multiprocessing.cpu_count() * 2 + 1 + +preload_app = True + +chdir = settings.BASE_DIR + +user = settings.PROCESS_USER +group = user + +log_dir = os.path.join( + os.path.dirname(settings.BASE_DIR), 'gunicorn_logs', settings.PROCESS_NAME) +if not os.path.isdir(log_dir): + os.makedirs(log_dir) + import pwd + import grp + os.chown(log_dir, + pwd.getpwnam(user).pw_uid, + grp.getgrnam(group).gr_gid) + +accesslog = os.path.join(log_dir, 'access.log') +errorlog = os.path.join(log_dir, 'error.log') + +proc_name = settings.PROCESS_NAME \ No newline at end of file diff --git a/deploy/production/nginx.conf b/deploy/production/nginx.conf new file mode 100644 index 0000000000..dfc719ae8c --- /dev/null +++ b/deploy/production/nginx.conf @@ -0,0 +1,34 @@ +server { + listen 80; + server_name mayan.crossculturalconsult.com www.mayan.crossculturalconsult.com; + + access_log /var/log/nginx/mayan.crossculturalconsult.com.access.log; + error_log /var/log/nginx/mayan.crossculturalconsult.com.error.log; + root /home/mayan/production/; + + location /static/ { + alias /home/mayan/production/static_collected/; + } + + location /media/ { + alias /home/mayan/production/media/; + } + + location = /favicon.ico { + alias /home/mayan/production/media/favicon.ico; + } + + location = /robots.txt { + alias /home/mayan/production/media/robots.txt; + } + + location / { + proxy_pass http://127.0.0.1:8731; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + client_max_body_size 10m; + } + allow all; +} \ No newline at end of file diff --git a/deploy/production/service_demon.sh b/deploy/production/service_demon.sh new file mode 100755 index 0000000000..8d591edc3d --- /dev/null +++ b/deploy/production/service_demon.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# Run the gunicorn service + +# Make sure we're in the right virtual env and location +source /home/mayan/.virtualenvs/production/bin/activate +source /home/mayan/.virtualenvs/production/bin/postactivate + +cd /home/mayan/production + +exec gunicorn -c /home/mayan/production/deploy/gunicorn.conf.py mayan.wsgi:application \ No newline at end of file diff --git a/deploy/production/upstart.conf b/deploy/production/upstart.conf new file mode 100644 index 0000000000..261d408b83 --- /dev/null +++ b/deploy/production/upstart.conf @@ -0,0 +1,10 @@ +start on started rc +stop on stopped rc + +respawn +respawn limit 3 5 + +setuid mayan +setgid mayan + +exec /home/mayan/production/deploy/production/service_demon.sh \ No newline at end of file diff --git a/mayan/settings/production.py b/mayan/settings/production.py index e5f50a7de3..4c3b69ff43 100644 --- a/mayan/settings/production.py +++ b/mayan/settings/production.py @@ -5,4 +5,16 @@ from .includes.common import * DEBUG = False TEMPLATE_DEBUG = DEBUG -ALLOWED_HOSTS = ['.crossculturalconsult.com'] \ No newline at end of file +ALLOWED_HOSTS = ['.crossculturalconsult.com'] + + +################### +# DEPLOY SETTINGS # +################### + +GUNICORN_BIND = "127.0.0.1:8731" +PROCESS_USER = 'mayan' +PROCESS_NAME = 'mayan_production' +SITE_TITLE = 'Mayan CCCS' +SITE_TAGLINE = None +VIRTUALENV = 'production' \ No newline at end of file From ec6466dce29fcb7ce9319970beda76c1d44b92a0 Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 17:43:38 +1000 Subject: [PATCH 16/17] removed redundant import --- mayan/settings/production.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/mayan/settings/production.py b/mayan/settings/production.py index 4c3b69ff43..2b8723c874 100644 --- a/mayan/settings/production.py +++ b/mayan/settings/production.py @@ -1,7 +1,5 @@ from .includes.common import * -from .includes.common import * - DEBUG = False TEMPLATE_DEBUG = DEBUG From a05424c79941dbfebf8db62eda6f1a83198693b2 Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 18:01:42 +1000 Subject: [PATCH 17/17] Added gunicorn to production requirements --- requirements/production.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/production.txt b/requirements/production.txt index 2f1bacec15..139920171b 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -1,2 +1,3 @@ # requirements/production.txt -r common.txt +gunicorn==19.0.0