summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Velásquez <angvp@archlinux.org>2017-05-24 03:30:10 -0400
committerGitHub <noreply@github.com>2017-05-24 03:30:09 -0400
commit0144bc7a240cf3984f9abde4df52c72c24c1b634 (patch)
treec5590c5f02a7866a1b84216d399b0a125cebbce4
parenta68d67c6fe0ed01cd158e8a0c9c42bafb9820d33 (diff)
parent9f7ad1aa841ea038a1ca540624d334816b8c8e84 (diff)
downloadarchweb-0144bc7a240cf3984f9abde4df52c72c24c1b634.tar.gz
archweb-0144bc7a240cf3984f9abde4df52c72c24c1b634.zip
Merge pull request #21 from jelly/debug_template
Debug template
-rw-r--r--settings.py47
1 files changed, 23 insertions, 24 deletions
diff --git a/settings.py b/settings.py
index 4a0ca9d2..e59fb753 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,26 +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',
- ],
- }
- }
-]
-
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
@@ -81,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
@@ -190,6 +170,25 @@ 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',
+ ],
+ }
+ }
+]
+
# Enable the debug toolbar if requested
if DEBUG_TOOLBAR:
MIDDLEWARE_CLASSES = \