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