From 2b8f7772aded961c376979f14cf95e6da5eb280f Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 5 Oct 2010 11:55:30 -0500 Subject: Make it possible to override settings By importing local settings at the end, you can override settings specified in settings.py. Helpful for something like the Django debug toolbar. The template loader needs to come last, however, in order to respect the TEMPLATE_DEBUG setting. Signed-off-by: Dan McGee --- settings.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'settings.py') diff --git a/settings.py b/settings.py index ea87c2c..2334a47 100644 --- a/settings.py +++ b/settings.py @@ -1,12 +1,15 @@ import os # Django settings for archweb project. -## Import local settings -from local_settings import * - ## Set the debug values +DEBUG = False TEMPLATE_DEBUG = DEBUG +## Notification admins +ADMINS = ( + ('Dan McGee', 'dan@archlinux.org'), +) + # Set managers to admins MANAGERS = ADMINS @@ -90,12 +93,6 @@ TEMPLATE_LOADERS = ( 'django.template.loaders.app_directories.Loader', ) -# Enable caching templates in production environments -if not TEMPLATE_DEBUG: - TEMPLATE_LOADERS = ( - ('django.template.loaders.cached.Loader', TEMPLATE_LOADERS), - ) - # Set django's User stuff to use our profile model # format is app.model AUTH_PROFILE_MODULE = 'main.UserProfile' @@ -123,4 +120,13 @@ INSTALLED_APPS = ( 'south', # database migration support ) +## Import local settings +from local_settings import * + +# Enable caching templates in production environments +if not TEMPLATE_DEBUG: + TEMPLATE_LOADERS = ( + ('django.template.loaders.cached.Loader', TEMPLATE_LOADERS), + ) + # vim: set ts=4 sw=4 et: -- cgit v1.2.3-24-g4f1b