summaryrefslogtreecommitdiff
path: root/settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'settings.py')
-rw-r--r--settings.py49
1 files changed, 24 insertions, 25 deletions
diff --git a/settings.py b/settings.py
index a1216f2d..01e93995 100644
--- a/settings.py
+++ b/settings.py
@@ -1,5 +1,5 @@
-import os
# Django settings for archweb project.
+from os import path
## Set the debug values
DEBUG = False
@@ -15,7 +15,7 @@ MANAGERS = ADMINS
NOTIFICATIONS = ['arch-notifications@archlinux.org']
# Full path to the data directory
-DEPLOY_PATH = os.path.dirname(os.path.realpath(__file__))
+DEPLOY_PATH = path.dirname(path.realpath(__file__))
# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True
@@ -44,27 +44,6 @@ LOGIN_REDIRECT_URL = '/'
# Set django's User stuff to use our profile model
AUTH_PROFILE_MODULE = 'devel.UserProfile'
-from os import path
-TEMPLATES = [
- {
- 'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [
- path.join(DEPLOY_PATH, 'templates')
- ],
- 'APP_DIRS': True,
- 'OPTIONS': {
- 'debug': DEBUG,
- 'context_processors': [
- 'django.contrib.auth.context_processors.auth',
- 'django.core.context_processors.debug',
- 'django.contrib.messages.context_processors.messages',
- 'main.context_processors.secure',
- 'main.context_processors.branding',
- ],
- }
- }
-]
-
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
@@ -82,11 +61,11 @@ ROOT_URLCONF = 'urls'
STATIC_URL = '/static/'
# Location to collect static files
-STATIC_ROOT = os.path.join(DEPLOY_PATH, 'collected_static')
+STATIC_ROOT = path.join(DEPLOY_PATH, 'collected_static')
# Look for more static files in these locations
STATICFILES_DIRS = (
- os.path.join(DEPLOY_PATH, 'sitestatic'),
+ path.join(DEPLOY_PATH, 'sitestatic'),
)
# Static files backend that allows us to use far future Expires headers
@@ -221,6 +200,26 @@ try:
except ImportError:
pass
+TEMPLATES = [
+ {
+ 'BACKEND': 'django.template.backends.django.DjangoTemplates',
+ 'DIRS': [
+ path.join(DEPLOY_PATH, 'templates')
+ ],
+ 'APP_DIRS': True,
+ 'OPTIONS': {
+ 'debug': DEBUG,
+ 'context_processors': [
+ 'django.contrib.auth.context_processors.auth',
+ 'django.core.context_processors.debug',
+ 'django.contrib.messages.context_processors.messages',
+ 'main.context_processors.secure',
+ 'main.context_processors.branding',
+ ],
+ }
+ }
+]
+
# Enable the debug toolbar if requested
if DEBUG_TOOLBAR:
MIDDLEWARE_CLASSES = \