]> git.0d.be Git - panikdb.git/blob - panikdb/settings.py
add full width page template variant
[panikdb.git] / panikdb / settings.py
1 # Django settings for panikdb project.
2
3 import os
4
5 DEBUG = True
6 TEMPLATE_DEBUG = DEBUG
7 DEBUG_TOOLBAR = True
8
9 PROJECT_PATH = os.path.dirname(os.path.dirname(__file__))
10
11 ADMINS = (
12     ('Frederic Peters', 'fred@radiopanik.org'),
13 )
14
15 MANAGERS = ADMINS
16
17 DATABASES = {
18     'default': {
19         'ENGINE': 'django.db.backends.sqlite3',
20         'NAME': os.path.join(PROJECT_PATH, 'panikdb.sqlite3'),
21     }
22 }
23
24 # Hosts/domain names that are valid for this site; required if DEBUG is False
25 # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
26 ALLOWED_HOSTS = []
27
28 # Local time zone for this installation. Choices can be found here:
29 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
30 # although not all choices may be available on all operating systems.
31 # In a Windows environment this must be set to your system time zone.
32 TIME_ZONE = 'Europe/Brussels'
33
34 # Language code for this installation. All choices can be found here:
35 # http://www.i18nguy.com/unicode/language-identifiers.html
36 LANGUAGE_CODE = 'fr-be'
37
38 SITE_ID = 1
39
40 # If you set this to False, Django will make some optimizations so as not
41 # to load the internationalization machinery.
42 USE_I18N = True
43
44 # If you set this to False, Django will not format dates, numbers and
45 # calendars according to the current locale.
46 USE_L10N = True
47
48 # If you set this to False, Django will not use timezone-aware datetimes.
49 USE_TZ = False
50
51 # Absolute filesystem path to the directory that will hold user-uploaded files.
52 # Example: "/var/www/example.com/media/"
53 MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
54
55 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
56 # trailing slash.
57 # Examples: "http://example.com/media/", "http://media.example.com/"
58 MEDIA_URL = '/media/'
59
60 # Absolute path to the directory static files should be collected to.
61 # Don't put anything in this directory yourself; store your static files
62 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
63 # Example: "/var/www/example.com/static/"
64 STATIC_ROOT = os.path.join(PROJECT_PATH, 'static')
65
66 # URL prefix for static files.
67 # Example: "http://example.com/static/", "http://static.example.com/"
68 STATIC_URL = '/static/'
69
70 CKEDITOR_UPLOAD_PATH = 'uploads/'
71 CKEDITOR_UPLOAD_PREFIX = '/media/uploads/'
72
73 # Additional locations of static files
74 STATICFILES_DIRS = (
75     # Put strings here, like "/home/html/static" or "C:/www/django/static".
76     # Always use forward slashes, even on Windows.
77     # Don't forget to use absolute paths, not relative paths.
78     os.path.join(PROJECT_PATH, 'panikdb', 'static'),
79 )
80
81 # List of finder classes that know how to find static files in
82 # various locations.
83 STATICFILES_FINDERS = (
84     'django.contrib.staticfiles.finders.FileSystemFinder',
85     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
86 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
87 )
88
89 # Make this unique, and don't share it with anybody.
90 SECRET_KEY = '(jwx-1y#d#vps93glikirr&tq_!^_4g+9-qj(jy#l=sllqw(^j'
91
92 # List of callables that know how to import templates from various sources.
93 TEMPLATE_LOADERS = (
94     'django.template.loaders.filesystem.Loader',
95     'django.template.loaders.app_directories.Loader',
96 #     'django.template.loaders.eggs.Loader',
97 )
98
99 MIDDLEWARE_CLASSES = (
100     'django.middleware.common.CommonMiddleware',
101     'django.contrib.sessions.middleware.SessionMiddleware',
102     'django.middleware.csrf.CsrfViewMiddleware',
103     'django.contrib.auth.middleware.AuthenticationMiddleware',
104     'django.contrib.messages.middleware.MessageMiddleware',
105     # Uncomment the next line for simple clickjacking protection:
106     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
107 )
108
109 ROOT_URLCONF = 'panikdb.urls'
110
111 # Python dotted path to the WSGI application used by Django's runserver.
112 WSGI_APPLICATION = 'panikdb.wsgi.application'
113
114 TEMPLATE_DIRS = (
115     os.path.join(PROJECT_PATH, 'panikdb', 'templates'),
116 )
117
118 INSTALLED_APPS = (
119     'django.contrib.auth',
120     'django.contrib.contenttypes',
121     'django.contrib.sessions',
122     'django.contrib.sites',
123     'django.contrib.messages',
124     'django.contrib.staticfiles',
125     'django.contrib.admin',
126     'registration',
127     'ckeditor',
128     'haystack',
129     'taggit',
130     'jquery',
131     'datetimewidget',
132     'django_bootstrap_staticfiles',
133     'emissions',
134     'newsletter',
135     'matos',
136     'nonstop',
137     'panikdb.aa',
138     'panikdb.customtags',
139     'panikdb.stats',
140     'gadjo',
141     'combo.data',
142     'combo.manager',
143     'panikombo',
144     'django_select2',
145 )
146
147 # A sample logging configuration. The only tangible logging
148 # performed by this configuration is to send an email to
149 # the site admins on every HTTP 500 error when DEBUG=False.
150 # See http://docs.djangoproject.com/en/dev/topics/logging for
151 # more details on how to customize your logging configuration.
152 LOGGING = {
153     'version': 1,
154     'disable_existing_loggers': False,
155     'filters': {
156         'require_debug_false': {
157             '()': 'django.utils.log.RequireDebugFalse'
158         }
159     },
160     'handlers': {
161         'mail_admins': {
162             'level': 'ERROR',
163             'filters': ['require_debug_false'],
164             'class': 'django.utils.log.AdminEmailHandler'
165         }
166     },
167     'loggers': {
168         'django.request': {
169             'handlers': ['mail_admins'],
170             'level': 'ERROR',
171             'propagate': True,
172         },
173     }
174 }
175
176 CKEDITOR_CONFIGS = {
177     'default': {
178         'toolbar_Own': [['Source', 'Format', '-', 'Bold', 'Italic'],
179                         ['NumberedList','BulletedList'],
180                         ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
181                         ['Link', 'Unlink'],
182                         ['Image',],
183                         ['RemoveFormat',]],
184         'toolbar': 'Own',
185     },
186 }
187
188 HAYSTACK_CONNECTIONS = {
189     'default': {
190         'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
191         'URL': 'http://127.0.0.1:8985/solr/panik'
192     },
193 }
194
195 CACHES = {
196     'default': {
197         'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
198     },
199 }
200
201 TEST_RUNNER = 'django.test.runner.DiscoverRunner'
202
203 AUTH_USER_MODEL = 'aa.User'
204 LOGIN_REDIRECT_URL = '/'
205 WEBSITE_BASE_URL = 'http://www.radiopanik.org/'
206
207 NEWSLETTER_SENDER = 'info@radiopanik.org'
208 NEWSLETTER_DOMAIN = 'radiopanik.org'
209 NEWSLETTER_STYLE = """
210 body { color: #222; text-align: justify; }
211 h2, h3 { font-family: "Reglo"; }
212 h3 { margin-bottom: 0; }
213 h3 + p { margin-top: 0; }
214 p strong { color: black; }
215 h3 strong { text-transform: uppercase; color: blue; }
216 p a { color: black; text-decoration: none; border-bottom: 1px dotted black; }
217 p a:hover { border-bottom: 1px solid black; }
218 """
219
220 RAVEN_CONFIG = None
221
222 COMBO_PUBLIC_TEMPLATES = {
223     'standard': {
224         'name': 'Standard',
225         'template': 'combo/page_template.html',
226         'placeholders': {
227             'content': {
228                 'name': 'Content',
229             },
230         }
231     },
232     'fullwidth': {
233         'name': 'Fullwidth',
234         'template': 'combo/page_template_full_width.html',
235         'placeholders': {
236             'content': {
237                 'name': 'Content',
238             },
239         }
240     },
241
242 }
243
244 AUTO_RENDER_SELECT2_STATICS = False
245
246 try:
247     from local_settings import *
248 except ImportError:
249     pass
250
251 if DEBUG and DEBUG_TOOLBAR:
252     MIDDLEWARE_CLASSES += (
253         'debug_toolbar.middleware.DebugToolbarMiddleware',
254     )
255     INSTALLED_APPS += (
256         'debug_toolbar',
257     )
258
259 if RAVEN_CONFIG:
260     INSTALLED_APPS += (
261         'raven.contrib.django.raven_compat',
262     )