]> git.0d.be Git - panikweb.git/blob - panikweb/settings.py
remove south from installed_apps
[panikweb.git] / panikweb / settings.py
1 #!/usr/bin/env python
2 # coding: utf-8
3
4 import os
5
6 import django.conf.global_settings as DEFAULT_SETTINGS
7
8 DEBUG = True  # Turn off for production
9 TEMPLATE_DEBUG = DEBUG
10 DEBUG_TOOLBAR = False
11
12 PROJECT_DIR = os.path.normpath(os.path.dirname(os.path.dirname(__file__)))
13 ADMINS = (
14     # ('Your Name', 'your_email@domain.com'),
15 )
16 MANAGERS = ADMINS
17 DEFAULT_FROM_EMAIL = 'info@radiopanik.org'
18
19 LOGIN_REDIRECT_URL = '/'
20
21 DATABASES = {
22     'default': {
23         'ENGINE': 'django.db.backends.sqlite3',
24         'NAME': os.path.join(PROJECT_DIR, 'panikweb.sqlite3'),
25         'USER': '',
26         'PASSWORD': '',
27         'HOST': '',
28         'PORT': '',
29     },
30 }
31
32 ACCOUNT_ACTIVATION_DAYS = 7  # Activation window
33
34 #if django.VERSION[:2] < (1, 6):
35 TEST_RUNNER = 'discover_runner.DiscoverRunner'
36
37 # Local time zone for this installation. Choices can be found here:
38 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
39 # although not all choices may be available on all operating systems.
40 # If running in a Windows environment this must be set to the same as your
41 # system time zone.
42 TIME_ZONE = 'Europe/Brussels'
43
44 # Language code for this installation. All choices can be found here:
45 # http://www.i18nguy.com/unicode/language-identifiers.html
46 LANGUAGE_CODE = 'fr-be'
47
48 LANGUAGES = (
49   ('fr', u'Français'),
50 )
51
52 SITE_ID = 1
53
54 # If you set this to False, Django will make some optimizations so as not
55 # to load the internationalization machinery.
56 USE_I18N = True
57
58 LOCALE_PATHS = (os.path.join(PROJECT_DIR, 'panikweb', 'locale'),)
59
60 # Absolute filesystem path to the directory that will hold user-uploaded files.
61 # Example: "/home/media/media.lawrence.com/media/"
62 MEDIA_ROOT = os.path.join(PROJECT_DIR, 'media')
63
64 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
65 # trailing slash.
66 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
67 MEDIA_URL = '/media/'
68
69 # Absolute path to the directory static files should be collected to.
70 # Don't put anything in this directory yourself; store your static files
71 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
72 # Example: "/home/media/media.lawrence.com/static/"
73 STATIC_ROOT = os.path.join(PROJECT_DIR, 'staticroot')
74
75 # URL prefix for static files.
76 # Example: "http://media.lawrence.com/static/"
77 STATIC_URL = '/static/'
78
79 # Additional locations of static files
80 STATICFILES_DIRS = (
81     # Put strings here, like "/home/html/static" or "C:/www/django/static".
82     # Always use forward slashes, even on Windows.
83     # Don't forget to use absolute paths, not relative paths.
84 )
85
86 # List of finder classes that know how to find static files in
87 # various locations.
88 STATICFILES_FINDERS = (
89     'django.contrib.staticfiles.finders.FileSystemFinder',
90     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
91     'compressor.finders.CompressorFinder',
92 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
93 )
94
95 # Make this unique, and don't share it with anybody.
96 SECRET_KEY = '3qm&amp;@6264-=st16)7_xa*ds+31e0mqqs@+*!ud7gzt$tq!b^qn'
97
98 # List of callables that know how to import templates from various sources.
99 TEMPLATE_LOADERS = (
100     'django.template.loaders.filesystem.Loader',
101     'django.template.loaders.app_directories.Loader',
102 #     'django.template.loaders.eggs.load_template_source',
103 )
104
105 MIDDLEWARE_CLASSES = (
106     'django.middleware.cache.UpdateCacheMiddleware',
107     'django.middleware.gzip.GZipMiddleware',
108     'django.contrib.sessions.middleware.SessionMiddleware',
109     'django.middleware.common.CommonMiddleware',
110     'django.middleware.csrf.CsrfViewMiddleware',
111     'django.contrib.auth.middleware.AuthenticationMiddleware',
112     'django.contrib.messages.middleware.MessageMiddleware',
113     'fiber.middleware.ObfuscateEmailAddressMiddleware',
114     'fiber.middleware.AdminPageMiddleware',
115     #'request.middleware.RequestMiddleware',
116     'panikweb.middleware.StripPiwikCookieMiddleware',
117     'django.middleware.cache.FetchFromCacheMiddleware',
118 )
119
120 TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + (
121     'django.core.context_processors.request',
122 )
123
124
125 ROOT_URLCONF = 'panikweb.urls'
126
127 TEMPLATE_DIRS = (
128     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
129     # Always use forward slashes, even on Windows.
130     # Don't forget to use absolute paths, not relative paths.
131 )
132
133 INSTALLED_APPS = (
134     'django.contrib.auth',
135     'django.contrib.contenttypes',
136     'django.contrib.sessions',
137     'django.contrib.sites',
138     'django.contrib.messages',
139     'django.contrib.staticfiles',
140     'django.contrib.admin',
141     'django.contrib.admindocs',
142     'haystack',
143     'taggit',
144     'panikweb_templates',
145     'panikweb.paniktags',
146     'mptt',
147     'compressor',
148     'fiber',
149     'jquery',
150     'ckeditor',
151     'emissions',
152     'newsletter',
153 )
154
155 CKEDITOR_UPLOAD_PATH = os.path.join(MEDIA_ROOT, 'uploads')
156 CKEDITOR_UPLOAD_PREFIX = '/media/uploads/'
157
158 HAYSTACK_CONNECTIONS = {
159     'default': {
160         'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
161         'URL': 'http://127.0.0.1:8985/solr/panik'
162     },
163 }
164
165 FIBER_TEMPLATE_CHOICES = (
166     ('tpl-default.html', 'Default template'),
167 )
168
169 ENABLE_PIWIK = False
170
171 CACHES = {
172     'default': {
173         'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
174     },
175 }
176
177 LOGGING = {
178     'version': 1,
179     'disable_existing_loggers': False,
180     'filters': {
181         'require_debug_false': {
182             '()': 'django.utils.log.RequireDebugFalse'
183         }
184     },
185     'handlers': {
186         'mail_admins': {
187             'level': 'ERROR',
188             'filters': ['require_debug_false'],
189             'class': 'django.utils.log.AdminEmailHandler'
190         }
191     },
192     'loggers': {
193         'django.request': {
194             'handlers': ['mail_admins'],
195             'level': 'ERROR',
196             'propagate': True,
197         },
198     }
199 }
200
201 STATSD_CLIENT = 'django_statsd.clients.null'
202
203 RAVEN_CONFIG = None
204
205 DEBUG_TOOLBAR_PANELS = (
206     'debug_toolbar.panels.version.VersionDebugPanel',
207     'debug_toolbar.panels.timer.TimerDebugPanel',
208     'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel',
209     'debug_toolbar.panels.headers.HeaderDebugPanel',
210     'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
211     'debug_toolbar.panels.sql.SQLDebugPanel',
212     'debug_toolbar.panels.template.TemplateDebugPanel',
213     'debug_toolbar.panels.signals.SignalDebugPanel',
214     'debug_toolbar.panels.logger.LoggingPanel',
215 )
216
217 try:
218     from local_settings import *
219 except ImportError, e:
220     pass
221
222 if DEBUG and DEBUG_TOOLBAR:
223     MIDDLEWARE_CLASSES += (
224         'debug_toolbar.middleware.DebugToolbarMiddleware',
225     )
226     INSTALLED_APPS += (
227         'debug_toolbar',
228     )
229
230     if 'template_timings_panel.panels.TemplateTimings.TemplateTimings' in DEBUG_TOOLBAR_PANELS:
231         INSTALLED_APPS += ('template_timings_panel',)
232
233 if ENABLE_PIWIK is False:
234     MIDDLEWARE_CLASSES = tuple([x for x in MIDDLEWARE_CLASSES \
235                                 if x != 'panikweb.middleware.StripPiwikCookieMiddleware'])
236
237 if STATSD_CLIENT != 'django_statsd.clients.null':
238     MIDDLEWARE_CLASSES = (
239             'django_statsd.middleware.GraphiteRequestTimingMiddleware',
240             'django_statsd.middleware.GraphiteMiddleware',
241     ) + MIDDLEWARE_CLASSES
242     INSTALLED_APPS += (
243         'django_statsd',
244     )
245
246 if RAVEN_CONFIG:
247     INSTALLED_APPS += (
248         'raven.contrib.django.raven_compat',
249     )