Mercurial > public > madeira
comparison mysite/settings.py @ 26:efb2da0b5d10
Merging the django1.3 branch into trunk.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 30 Mar 2011 00:16:32 +0000 |
parents | 0dcfcdf50c62 |
children |
comparison
equal
deleted
inserted
replaced
21:f3052378ab47 | 26:efb2da0b5d10 |
---|---|
12 ('Brian Neal', 'admin@surfguitar101.com'), | 12 ('Brian Neal', 'admin@surfguitar101.com'), |
13 ) | 13 ) |
14 | 14 |
15 MANAGERS = ADMINS | 15 MANAGERS = ADMINS |
16 | 16 |
17 DATABASE_ENGINE = local_settings.DATABASE_ENGINE | 17 DATABASES = local_settings.DATABASES |
18 DATABASE_NAME = local_settings.DATABASE_NAME | |
19 DATABASE_USER = local_settings.DATABASE_USER | |
20 DATABASE_PASSWORD = local_settings.DATABASE_PASSWORD | |
21 DATABASE_HOST = local_settings.DATABASE_HOST | |
22 DATABASE_PORT = local_settings.DATABASE_PORT | |
23 | 18 |
24 INTERNAL_IPS = local_settings.INTERNAL_IPS | 19 INTERNAL_IPS = local_settings.INTERNAL_IPS |
25 | 20 |
26 # Local time zone for this installation. Choices can be found here: | 21 # Local time zone for this installation. Choices can be found here: |
27 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name | 22 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
52 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a | 47 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
53 # trailing slash. | 48 # trailing slash. |
54 # Examples: "http://foo.com/media/", "/media/". | 49 # Examples: "http://foo.com/media/", "/media/". |
55 ADMIN_MEDIA_PREFIX = local_settings.ADMIN_MEDIA_PREFIX | 50 ADMIN_MEDIA_PREFIX = local_settings.ADMIN_MEDIA_PREFIX |
56 | 51 |
52 # Staticfiles settings: | |
53 STATICFILES_DIRS = local_settings.STATICFILES_DIRS | |
54 STATIC_ROOT = local_settings.STATIC_ROOT | |
55 STATIC_URL = local_settings.STATIC_URL | |
56 | |
57 # Make this unique, and don't share it with anybody. | 57 # Make this unique, and don't share it with anybody. |
58 SECRET_KEY = local_settings.SECRET_KEY | 58 SECRET_KEY = local_settings.SECRET_KEY |
59 | 59 |
60 # List of callables that know how to import templates from various sources. | 60 if DEBUG: |
61 TEMPLATE_LOADERS = ( | 61 TEMPLATE_LOADERS = ( |
62 'django.template.loaders.filesystem.load_template_source', | 62 'django.template.loaders.filesystem.Loader', |
63 'django.template.loaders.app_directories.load_template_source', | 63 'django.template.loaders.app_directories.Loader', |
64 ) | 64 ) |
65 else: | |
66 TEMPLATE_LOADERS = ( | |
67 ('django.template.loaders.cached.Loader', ( | |
68 'django.template.loaders.filesystem.Loader', | |
69 'django.template.loaders.app_directories.Loader', | |
70 )), | |
71 ) | |
65 | 72 |
66 if not DEBUG: | 73 if DEBUG: |
67 CACHE_BACKEND = local_settings.CACHE_BACKEND | 74 MIDDLEWARE_CLASSES = ( |
68 CACHE_MIDDLEWARE_SECONDS = local_settings.CACHE_MIDDLEWARE_SECONDS | 75 'django.middleware.common.CommonMiddleware', |
69 CACHE_MIDDLEWARE_KEY_PREFIX = local_settings.CACHE_MIDDLEWARE_KEY_PREFIX | 76 'django.middleware.csrf.CsrfViewMiddleware', |
70 CACHE_MIDDLEWARE_ANONYMOUS_ONLY = local_settings.CACHE_MIDDLEWARE_ANONYMOUS_ONLY | 77 'django.contrib.sessions.middleware.SessionMiddleware', |
78 'django.contrib.messages.middleware.MessageMiddleware', | |
79 'debug_toolbar.middleware.DebugToolbarMiddleware', | |
80 'django.contrib.auth.middleware.AuthenticationMiddleware', | |
81 'django.middleware.doc.XViewMiddleware', | |
82 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', | |
83 ) | |
84 else: | |
85 MIDDLEWARE_CLASSES = ( | |
86 'django.middleware.common.CommonMiddleware', | |
87 'django.middleware.csrf.CsrfViewMiddleware', | |
88 'django.contrib.sessions.middleware.SessionMiddleware', | |
89 'django.contrib.messages.middleware.MessageMiddleware', | |
90 'django.contrib.auth.middleware.AuthenticationMiddleware', | |
91 'django.middleware.doc.XViewMiddleware', | |
92 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware', | |
93 ) | |
71 | 94 |
72 MIDDLEWARE_CLASSES = local_settings.MIDDLEWARE_CLASSES | 95 ####################################################################### |
96 # Caching | |
97 ####################################################################### | |
98 if local_settings.USE_CACHE: | |
99 CACHES = local_settings.CACHES | |
100 CACHE_MIDDLEWARE_ANONYMOUS_ONLY = local_settings.CACHE_MIDDLEWARE_ANONYMOUS_ONLY | |
101 CACHE_MIDDLEWARE_SECONDS = local_settings.CACHE_MIDDLEWARE_SECONDS | |
102 CACHE_MIDDLEWARE_KEY_PREFIX = local_settings.CACHE_MIDDLEWARE_KEY_PREFIX | |
73 | 103 |
74 ROOT_URLCONF = 'mysite.urls' | 104 ROOT_URLCONF = 'mysite.urls' |
75 | 105 |
76 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". | 106 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
77 # Always use forward slashes, even on Windows. | 107 # Always use forward slashes, even on Windows. |
81 os.path.join(project_path, 'templates', 'band'), | 111 os.path.join(project_path, 'templates', 'band'), |
82 os.path.join(project_path, 'photologue', 'templates'), | 112 os.path.join(project_path, 'photologue', 'templates'), |
83 ) | 113 ) |
84 | 114 |
85 TEMPLATE_CONTEXT_PROCESSORS = ( | 115 TEMPLATE_CONTEXT_PROCESSORS = ( |
86 'django.core.context_processors.auth', | 116 "django.contrib.auth.context_processors.auth", |
87 'django.core.context_processors.debug', | 117 "django.core.context_processors.debug", |
88 'django.core.context_processors.media', | 118 "django.core.context_processors.request", |
89 'django.core.context_processors.request' | 119 "django.core.context_processors.media", |
120 "django.core.context_processors.static", | |
121 "django.contrib.messages.context_processors.messages", | |
90 ) | 122 ) |
91 | 123 |
92 INSTALLED_APPS = ( | 124 INSTALLED_APPS = [ |
125 'django.contrib.admin', | |
126 'django.contrib.admindocs', | |
93 'django.contrib.auth', | 127 'django.contrib.auth', |
94 'django.contrib.contenttypes', | 128 'django.contrib.contenttypes', |
129 'django.contrib.flatpages', | |
130 'django.contrib.markup', | |
131 'django.contrib.messages', | |
95 'django.contrib.sessions', | 132 'django.contrib.sessions', |
96 'django.contrib.admin', | |
97 'django.contrib.markup', | |
98 'django.contrib.sites', | 133 'django.contrib.sites', |
99 'django.contrib.flatpages', | 134 'django.contrib.staticfiles', |
100 'mysite.band', | 135 'mysite.band', |
101 'mysite.photologue', | 136 'mysite.photologue', |
102 ) | 137 ] |
138 if DEBUG: | |
139 INSTALLED_APPS.append('debug_toolbar') | |
140 | |
141 ####################################################################### | |
142 # Messages | |
143 ####################################################################### | |
144 MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage' | |
145 | |
146 ####################################################################### | |
147 # Email | |
148 ####################################################################### | |
149 EMAIL_HOST = local_settings.EMAIL_HOST | |
150 EMAIL_PORT = local_settings.EMAIL_PORT | |
151 | |
152 ####################################################################### | |
153 # Sessions | |
154 ####################################################################### | |
155 SESSION_ENGINE = "django.contrib.sessions.backends.cached_db" | |
156 SESSION_COOKIE_AGE = 2 * 7 * 24 * 60 * 60 # 2 weeks in seconds | |
157 SESSION_COOKIE_DOMAIN = None | |
158 SESSION_COOKIE_NAME = 'madeira_sessionid' | |
159 SESSION_COOKIE_PATH = '/' | |
160 SESSION_COOKIE_SECURE = False | |
161 SESSION_EXPIRE_AT_BROWSER_CLOSE = False | |
162 SESSION_SAVE_EVERY_REQUEST = False | |
163 | |
164 ####################################################################### | |
165 # Configure Logging | |
166 ####################################################################### | |
167 | |
168 LOGGING = local_settings.LOGGING | |
169 | |
170 ####################################################################### | |
171 # Django Debug Toolbar | |
172 ####################################################################### | |
173 | |
174 if DEBUG: | |
175 DEBUG_TOOLBAR_CONFIG = local_settings.DEBUG_TOOLBAR_CONFIG | |
176 |