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