]> git.0d.be Git - panikdb.git/blob - panikdb/settings.py
0d5d9092ffbc49241b6f3ff4b344bd64a6ca6462
[panikdb.git] / panikdb / settings.py
1 # Django settings for panikdb project.
2 # coding: utf-8
3
4 import os
5 from django.conf import global_settings
6
7 DEBUG = True
8 TEMPLATE_DEBUG = DEBUG
9 DEBUG_TOOLBAR = True
10
11 PROJECT_PATH = os.path.dirname(os.path.dirname(__file__))
12
13 ADMINS = (
14     ('Frederic Peters', 'fred@radiopanik.org'),
15 )
16
17 MANAGERS = ADMINS
18
19 DATABASES = {
20     'default': {
21         'ENGINE': 'django.db.backends.sqlite3',
22         'NAME': os.path.join(PROJECT_PATH, 'panikdb.sqlite3'),
23     }
24 }
25
26 # Hosts/domain names that are valid for this site; required if DEBUG is False
27 # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
28 ALLOWED_HOSTS = []
29
30 # Local time zone for this installation. Choices can be found here:
31 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
32 # although not all choices may be available on all operating systems.
33 # In a Windows environment this must be set to your system time zone.
34 TIME_ZONE = 'Europe/Brussels'
35
36 # Language code for this installation. All choices can be found here:
37 # http://www.i18nguy.com/unicode/language-identifiers.html
38 LANGUAGE_CODE = 'fr-be'
39
40 SITE_ID = 1
41
42 # If you set this to False, Django will make some optimizations so as not
43 # to load the internationalization machinery.
44 USE_I18N = True
45
46 LOCALE_PATHS = (os.path.join(PROJECT_DIR, 'panikdb', 'locale'),)
47
48 # If you set this to False, Django will not format dates, numbers and
49 # calendars according to the current locale.
50 USE_L10N = True
51
52 # If you set this to False, Django will not use timezone-aware datetimes.
53 USE_TZ = False
54
55 # Absolute filesystem path to the directory that will hold user-uploaded files.
56 # Example: "/var/www/example.com/media/"
57 MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')
58
59 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
60 # trailing slash.
61 # Examples: "http://example.com/media/", "http://media.example.com/"
62 MEDIA_URL = '/media/'
63
64 # Absolute path to the directory static files should be collected to.
65 # Don't put anything in this directory yourself; store your static files
66 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
67 # Example: "/var/www/example.com/static/"
68 STATIC_ROOT = os.path.join(PROJECT_PATH, 'static')
69
70 # URL prefix for static files.
71 # Example: "http://example.com/static/", "http://static.example.com/"
72 STATIC_URL = '/static/'
73
74 CKEDITOR_UPLOAD_PATH = 'uploads/'
75 CKEDITOR_UPLOAD_PREFIX = '/media/uploads/'
76
77 # Additional locations of static files
78 STATICFILES_DIRS = (
79     # Put strings here, like "/home/html/static" or "C:/www/django/static".
80     # Always use forward slashes, even on Windows.
81     # Don't forget to use absolute paths, not relative paths.
82     os.path.join(PROJECT_PATH, 'panikdb', 'static'),
83 )
84
85 # List of finder classes that know how to find static files in
86 # various locations.
87 STATICFILES_FINDERS = global_settings.STATICFILES_FINDERS + \
88             ('gadjo.finders.XStaticFinder',)
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     'panikdb.poll',
142     'gadjo',
143     'combo.data',
144     'combo.manager',
145     'combo.apps.maps',
146     'sorl.thumbnail',
147     'gallery',
148     'panikombo',
149     'django_select2',
150 )
151
152 # A sample logging configuration. The only tangible logging
153 # performed by this configuration is to send an email to
154 # the site admins on every HTTP 500 error when DEBUG=False.
155 # See http://docs.djangoproject.com/en/dev/topics/logging for
156 # more details on how to customize your logging configuration.
157 LOGGING = {
158     'version': 1,
159     'disable_existing_loggers': False,
160     'filters': {
161         'require_debug_false': {
162             '()': 'django.utils.log.RequireDebugFalse'
163         }
164     },
165     'handlers': {
166         'mail_admins': {
167             'level': 'ERROR',
168             'filters': ['require_debug_false'],
169             'class': 'django.utils.log.AdminEmailHandler'
170         }
171     },
172     'loggers': {
173         'django.request': {
174             'handlers': ['mail_admins'],
175             'level': 'ERROR',
176             'propagate': True,
177         },
178     }
179 }
180
181 CKEDITOR_CONFIGS = {
182     'default': {
183         'allowedContent': True,
184         'filebrowserUploadUrl': '/ckeditor/upload/',
185         'filebrowserBrowseUrl': '/ckeditor/browse/',
186         'toolbar_Own': [['Source', 'Format', '-', 'Bold', 'Italic'],
187                         ['NumberedList','BulletedList'],
188                         ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
189                         ['Link', 'Unlink'],
190                         ['Image',],
191                         ['RemoveFormat',]],
192         'toolbar': 'Own',
193     },
194 }
195
196 HAYSTACK_CONNECTIONS = {
197     'default': {
198         'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
199         'URL': 'http://127.0.0.1:8985/solr/panik'
200     },
201 }
202
203 CACHES = {
204     'default': {
205         'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
206     },
207 }
208
209 TEST_RUNNER = 'django.test.runner.DiscoverRunner'
210
211 AUTH_USER_MODEL = 'aa.User'
212 LOGIN_REDIRECT_URL = '/'
213 WEBSITE_BASE_URL = 'http://www.radiopanik.org/'
214
215 NEWSLETTER_SENDER = 'info@radiopanik.org'
216 NEWSLETTER_DOMAIN = 'radiopanik.org'
217 NEWSLETTER_STYLE = """
218 body { color: #222; text-align: justify; }
219 h2, h3 { font-family: "Reglo"; }
220 h3 { margin-bottom: 0; }
221 h3 + p { margin-top: 0; }
222 p strong { color: black; }
223 h3 strong { text-transform: uppercase; color: blue; }
224 p a { color: black; text-decoration: none; border-bottom: 1px dotted black; }
225 p a:hover { border-bottom: 1px solid black; }
226 """
227
228 RAVEN_CONFIG = None
229
230 from panikombo.misc import COMBO_PUBLIC_TEMPLATES
231 COMBO_DEFAULT_PUBLIC_TEMPLATE = 'standard'
232
233 AUTO_RENDER_SELECT2_STATICS = False
234
235 PIGE_DOWNLOAD_BASE_URL = 'http://pige.panik/extractor/download.cgi'
236
237 JSON_CELL_TYPES = {}
238
239 TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + \
240             ('panikdb.context_processors.internal_ip',)
241
242 FILE_UPLOAD_DIRECTORY_PERMISSIONS = 0o755
243 FILE_UPLOAD_PERMISSIONS = 0o644
244
245 try:
246     from local_settings import *
247 except ImportError:
248     pass
249
250 if DEBUG and DEBUG_TOOLBAR:
251     MIDDLEWARE_CLASSES += (
252         'debug_toolbar.middleware.DebugToolbarMiddleware',
253     )
254     INSTALLED_APPS += (
255         'debug_toolbar',
256     )
257
258 if RAVEN_CONFIG:
259     INSTALLED_APPS += (
260         'raven.contrib.django.raven_compat',
261     )