Commits

Anonymous committed a0508f2

Cleaned up etc.settings

Comments (0)

Files changed (6)

etc/settings/__init__.py

-from etc.settings.generic import *
-from etc.settings.database import *
-from etc.settings.log import *
-from etc.settings.middleware import *
-from etc.settings.template import *
-from etc.settings.apps.compressor import *
+from .generic import *
+from .cache import *
+from .database import *
+from .log import *
+from .template import *
+from .apps.compressor import *

etc/settings/cache.py

+CACHES = {
+    'memcached': {
+        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
+        'LOCATION': '127.0.0.1:11211',
+    },
+    'database': {
+        'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
+        'LOCATION': '_cache',
+    },
+    'dummy': {
+        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
+    }
+}
+CACHES['default'] = CACHES['database']

etc/settings/database.py

 
 DATABASE_NAME = PROJECT
 
-DATABASES_DEFAULT = {
+DATABASES = {
     'default_sqlite': {
         'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': path.join(PROJECT_ROOT, 'db', '%s.sqlite3' % DJANGO_PROJECT),
+        'NAME': path.join(PROJECT_ROOT, 'db', '%s.sqlite3' % DATABASE_NAME),
     },
     'default_mysql': {
         'ENGINE': 'django.db.backends.mysql',
 }
 
 DATABASES = {
-    'default': DATABASES_DEFAULT['default_' + \
+    'default': DATABASES['default_' + \
                                  environ.get('DJANGO_DATABASE_TYPE', 'sqlite')]
 }

etc/settings/generic.py

 
 DEFAULT_FROM_EMAIL = 'g0j0 admin <%s>' % ADMINS[0][1]
 
-DEBUG = False
-TEMPLATE_DEBUG = DEBUG
+DEBUG = TEMPLATE_DEBUG = False
 
 TIME_ZONE = 'Europe/Amsterdam'
 
 STATIC_ID = 'static'
 STATIC_ROOT = path.join(PROJECT_ROOT, STATIC_ID)
 STATIC_URL = '/%s/' % STATIC_ID
+
 MEDIA_ID = 'media'
 MEDIA_ROOT = path.join(PROJECT_ROOT, MEDIA_ID)
 MEDIA_URL = '/%s/' % MEDIA_ID
 
 ROOT_URLCONF = DJANGO_PROJECT + '.urls'
 
-FIXTURE_DIRS = (
+MIDDLEWARE_CLASSES = (
+    'django.middleware.common.CommonMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.middleware.csrf.CsrfViewMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
 )
 
-CACHES = {
-    'memcached': {
-        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
-        'LOCATION': '127.0.0.1:11211',
-    },
-    'database': {
-        'BACKEND': 'django.core.cache.backends.db.DatabaseCache',
-        'LOCATION': '_cache',
-    },
-    'dummy': {
-        'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
-    }
-}
-CACHES['default'] = CACHES['database']
-
 SESSION_COOKIE_HTTPONLY = True

etc/settings/middleware.py

-MIDDLEWARE_CLASSES_DEFAULT = (
-    'django.middleware.common.CommonMiddleware',
-    'django.contrib.sessions.middleware.SessionMiddleware',
-    'django.middleware.csrf.CsrfViewMiddleware',
-    'django.contrib.auth.middleware.AuthenticationMiddleware',
-    'django.contrib.messages.middleware.MessageMiddleware',
-)
-
-MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES_DEFAULT

etc/settings/template.py

     'django.template.loaders.app_directories.Loader',
 )
 
-TEMPLATE_LOADERS = TEMPLATE_LOADERS_DEFAULT
-
 TEMPLATE_LOADERS_CACHED = (
     ('django.template.loaders.cached.Loader', TEMPLATE_LOADERS_DEFAULT),
 )
 
-TEMPLATE_CONTEXT_PROCESSORS_DEFAULT = (
+TEMPLATE_LOADERS = TEMPLATE_LOADERS_CACHED
+
+TEMPLATE_CONTEXT_PROCESSORS = (
     'django.contrib.auth.context_processors.auth',
     'django.core.context_processors.debug',
     'django.core.context_processors.i18n',
     'django.contrib.messages.context_processors.messages',
     'g0j0.context_processors.settings_proxy',
 )
-
-TEMPLATE_CONTEXT_PROCESSORS = TEMPLATE_CONTEXT_PROCESSORS_DEFAULT