Reconfigured settings to support mayan/apps and separate production and development.

This commit is contained in:
pwhipp
2014-07-10 07:29:38 +10:00
parent de5b9aaac9
commit 23ed5b15a2
7 changed files with 60 additions and 71 deletions

1
.gitignore vendored
View File

@@ -18,4 +18,5 @@ gpg_home/
.coverage
/dist/
.idea/
static_collected/
*egg-info*

View File

@@ -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': ''}}
'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',)

View File

@@ -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,
}

View File

@@ -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'

View File

@@ -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': ''}}

View File

@@ -32,3 +32,4 @@ South==0.8.4
unicode-slugify==0.1
wsgiref==0.1.2
psycopg2==2.5.3

View File

@@ -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