]> git.0d.be Git - panikdb.git/blob - panikdb/settings.py
settings: enable combo.apps.gallery
[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     'sorl.thumbnail',
144     'combo.apps.gallery',
145     'panikombo',
146     'django_select2',
147 )
148
149 # A sample logging configuration. The only tangible logging
150 # performed by this configuration is to send an email to
151 # the site admins on every HTTP 500 error when DEBUG=False.
152 # See http://docs.djangoproject.com/en/dev/topics/logging for
153 # more details on how to customize your logging configuration.
154 LOGGING = {
155     'version': 1,
156     'disable_existing_loggers': False,
157     'filters': {
158         'require_debug_false': {
159             '()': 'django.utils.log.RequireDebugFalse'
160         }
161     },
162     'handlers': {
163         'mail_admins': {
164             'level': 'ERROR',
165             'filters': ['require_debug_false'],
166             'class': 'django.utils.log.AdminEmailHandler'
167         }
168     },
169     'loggers': {
170         'django.request': {
171             'handlers': ['mail_admins'],
172             'level': 'ERROR',
173             'propagate': True,
174         },
175     }
176 }
177
178 CKEDITOR_CONFIGS = {
179     'default': {
180         'toolbar_Own': [['Source', 'Format', '-', 'Bold', 'Italic'],
181                         ['NumberedList','BulletedList'],
182                         ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
183                         ['Link', 'Unlink'],
184                         ['Image',],
185                         ['RemoveFormat',]],
186         'toolbar': 'Own',
187     },
188 }
189
190 HAYSTACK_CONNECTIONS = {
191     'default': {
192         'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
193         'URL': 'http://127.0.0.1:8985/solr/panik'
194     },
195 }
196
197 CACHES = {
198     'default': {
199         'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
200     },
201 }
202
203 TEST_RUNNER = 'django.test.runner.DiscoverRunner'
204
205 AUTH_USER_MODEL = 'aa.User'
206 LOGIN_REDIRECT_URL = '/'
207 WEBSITE_BASE_URL = 'http://www.radiopanik.org/'
208
209 NEWSLETTER_SENDER = 'info@radiopanik.org'
210 NEWSLETTER_DOMAIN = 'radiopanik.org'
211 NEWSLETTER_STYLE = """
212 body { color: #222; text-align: justify; }
213 h2, h3 { font-family: "Reglo"; }
214 h3 { margin-bottom: 0; }
215 h3 + p { margin-top: 0; }
216 p strong { color: black; }
217 h3 strong { text-transform: uppercase; color: blue; }
218 p a { color: black; text-decoration: none; border-bottom: 1px dotted black; }
219 p a:hover { border-bottom: 1px solid black; }
220 """
221
222 RAVEN_CONFIG = None
223
224 COMBO_PUBLIC_TEMPLATES = {
225     'standard': {
226         'name': 'Standard',
227         'template': 'combo/page_template.html',
228         'placeholders': {
229             'content': {
230                 'name': 'Content',
231             },
232         }
233     },
234     'fullwidth': {
235         'name': 'Fullwidth',
236         'template': 'combo/page_template_full_width.html',
237         'placeholders': {
238             'content': {
239                 'name': 'Content',
240             },
241         }
242     },
243
244 }
245
246 AUTO_RENDER_SELECT2_STATICS = False
247
248 try:
249     from local_settings import *
250 except ImportError:
251     pass
252
253 if DEBUG and DEBUG_TOOLBAR:
254     MIDDLEWARE_CLASSES += (
255         'debug_toolbar.middleware.DebugToolbarMiddleware',
256     )
257     INSTALLED_APPS += (
258         'debug_toolbar',
259     )
260
261 if RAVEN_CONFIG:
262     INSTALLED_APPS += (
263         'raven.contrib.django.raven_compat',
264     )