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