]> git.0d.be Git - panikdb.git/blob - panikdb/settings.py
use normal popup for add diffusion form
[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 DEBUG_TOOLBAR = True
9
10 PROJECT_DIR = os.path.normpath(os.path.dirname(os.path.dirname(__file__)))
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 = list(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 TEMPLATES = [
94     {
95         'BACKEND': 'django.template.backends.django.DjangoTemplates',
96         'DIRS': [
97             os.path.join(PROJECT_PATH, 'panikdb', 'templates'),
98         ],
99         'APP_DIRS': True,
100         'OPTIONS': {
101             'context_processors': [
102                 'django.contrib.auth.context_processors.auth',
103                 'django.template.context_processors.debug',
104                 'django.template.context_processors.i18n',
105                 'django.template.context_processors.media',
106                 'django.template.context_processors.static',
107                 'django.template.context_processors.tz',
108                 'django.contrib.messages.context_processors.messages',
109                 'panikdb.context_processors.internal_ip',
110             ],
111         },
112     },
113 ]
114
115
116
117 MIDDLEWARE_CLASSES = (
118     'django.middleware.common.CommonMiddleware',
119     'django.contrib.sessions.middleware.SessionMiddleware',
120     'django.middleware.csrf.CsrfViewMiddleware',
121     'django.contrib.auth.middleware.AuthenticationMiddleware',
122     'django.contrib.messages.middleware.MessageMiddleware',
123     # Uncomment the next line for simple clickjacking protection:
124     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
125 )
126
127 ROOT_URLCONF = 'panikdb.urls'
128
129 # Python dotted path to the WSGI application used by Django's runserver.
130 WSGI_APPLICATION = 'panikdb.wsgi.application'
131
132 INSTALLED_APPS = (
133     'django.contrib.auth',
134     'django.contrib.contenttypes',
135     'django.contrib.sessions',
136     'django.contrib.sites',
137     'django.contrib.messages',
138     'django.contrib.staticfiles',
139     'django.contrib.admin',
140     'registration',
141     'ckeditor',
142     'haystack',
143     'taggit',
144     'emissions',
145     'newsletter',
146     'matos',
147     'nonstop',
148     'panikdb.aa',
149     'panikdb.customtags',
150     'panikdb.stats',
151     'panikdb.poll',
152     'gadjo',
153     'combo.data',
154     'combo.manager',
155     'combo.apps.assets',
156     'combo.apps.maps',
157     'combo.apps.notifications',
158     'combo.apps.pwa',
159     'sorl.thumbnail',
160     'gallery',
161     'panikombo',
162     'django_select2',
163 )
164
165 # A sample logging configuration. The only tangible logging
166 # performed by this configuration is to send an email to
167 # the site admins on every HTTP 500 error when DEBUG=False.
168 # See http://docs.djangoproject.com/en/dev/topics/logging for
169 # more details on how to customize your logging configuration.
170 LOGGING = {
171     'version': 1,
172     'disable_existing_loggers': False,
173     'filters': {
174         'require_debug_false': {
175             '()': 'django.utils.log.RequireDebugFalse'
176         }
177     },
178     'handlers': {
179         'mail_admins': {
180             'level': 'ERROR',
181             'filters': ['require_debug_false'],
182             'class': 'django.utils.log.AdminEmailHandler'
183         }
184     },
185     'loggers': {
186         'django.request': {
187             'handlers': ['mail_admins'],
188             'level': 'ERROR',
189             'propagate': True,
190         },
191     }
192 }
193
194 CKEDITOR_CONFIGS = {
195     'default': {
196         'allowedContent': True,
197         'filebrowserUploadUrl': '/ckeditor/upload/',
198         'filebrowserBrowseUrl': '/ckeditor/browse/',
199         'toolbar_Own': [['Source', 'Format', '-', 'Bold', 'Italic'],
200                         ['NumberedList','BulletedList'],
201                         ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'],
202                         ['Link', 'Unlink'],
203                         ['Image',],
204                         ['RemoveFormat',]],
205         'toolbar': 'Own',
206     },
207 }
208
209 HAYSTACK_CONNECTIONS = {
210     'default': {
211         'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
212         'URL': 'http://127.0.0.1:8985/solr/panik'
213     },
214 }
215
216 CACHES = {
217     'default': {
218         'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
219     },
220 }
221
222 TEST_RUNNER = 'django.test.runner.DiscoverRunner'
223
224 AUTH_USER_MODEL = 'aa.User'
225 LOGIN_REDIRECT_URL = '/'
226 WEBSITE_BASE_URL = 'http://www.radiopanik.org/'
227
228 NEWSLETTER_SENDER = 'info@radiopanik.org'
229 NEWSLETTER_DOMAIN = 'radiopanik.org'
230 NEWSLETTER_STYLE = """
231 body { color: #222; text-align: justify; }
232 h2, h3 { font-family: "Reglo"; }
233 h3 { margin-bottom: 0; }
234 h3 + p { margin-top: 0; }
235 p strong { color: black; }
236 h3 strong { text-transform: uppercase; color: blue; }
237 p a { color: black; text-decoration: none; border-bottom: 1px dotted black; }
238 p a:hover { border-bottom: 1px solid black; }
239 """
240
241 RAVEN_CONFIG = None
242
243 from panikombo.misc import COMBO_PUBLIC_TEMPLATES
244 COMBO_DEFAULT_PUBLIC_TEMPLATE = 'standard'
245
246 AUTO_RENDER_SELECT2_STATICS = False
247
248 PIGE_DOWNLOAD_BASE_URL = 'http://pige.panik/extractor/download.cgi'
249
250 JSON_CELL_TYPES = {}
251
252 FILE_UPLOAD_DIRECTORY_PERMISSIONS = 0o755
253 FILE_UPLOAD_PERMISSIONS = 0o644
254
255 try:
256     from local_settings import *
257 except ImportError:
258     pass
259
260 if DEBUG and DEBUG_TOOLBAR:
261     MIDDLEWARE_CLASSES += (
262         'debug_toolbar.middleware.DebugToolbarMiddleware',
263     )
264     INSTALLED_APPS += (
265         'debug_toolbar',
266     )
267
268 if RAVEN_CONFIG:
269     INSTALLED_APPS += (
270         'raven.contrib.django.raven_compat',
271     )