dirty, ugly but workable
[prawokultury.git] / prawokultury / settings.py
1 # -*- coding: utf-8 -*-
2 # This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
4 #
5 # Django settings for prawokultury project.
6
7 DEBUG = True
8 TEMPLATE_DEBUG = DEBUG
9
10 ADMINS = (
11     # ('Your Name', 'your_email@example.com'),
12 )
13
14 MANAGERS = ADMINS
15
16 DATABASES = {
17     'default': {
18         'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
19         'NAME': 'dev.db',                      # Or path to database file if using sqlite3.
20         'USER': '',                      # Not used with sqlite3.
21         'PASSWORD': '',                  # Not used with sqlite3.
22         'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
23         'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
24     }
25 }
26
27 # Local time zone for this installation. Choices can be found here:
28 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
29 # although not all choices may be available on all operating systems.
30 # On Unix systems, a value of None will cause Django to use the same
31 # timezone as the operating system.
32 # If running in a Windows environment this must be set to the same as your
33 # system time zone.
34 TIME_ZONE = 'America/Chicago'
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 = 'pl'
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 # If you set this to False, Django will not format dates, numbers and
47 # calendars according to the current locale.
48 USE_L10N = True
49
50 # If you set this to False, Django will not use timezone-aware datetimes.
51 USE_TZ = True
52
53 # Absolute filesystem path to the directory that will hold user-uploaded files.
54 # Example: "/home/media/media.lawrence.com/media/"
55 #MEDIA_ROOT = '/home/rczajka/workspace/media/prawokultury/dynamic/'
56 MEDIA_ROOT = ''
57
58 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
59 # trailing slash.
60 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
61 MEDIA_URL = '/media/'
62
63 # Absolute path to the directory static files should be collected to.
64 # Don't put anything in this directory yourself; store your static files
65 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
66 # Example: "/home/media/media.lawrence.com/static/"
67 STATIC_ROOT = ''
68
69 # URL prefix for static files.
70 # Example: "http://media.lawrence.com/static/"
71 STATIC_URL = '/static/'
72
73 # Additional locations of static files
74 STATICFILES_DIRS = (
75     # Put strings here, like "/home/html/static" or "C:/www/django/static".
76     # Always use forward slashes, even on Windows.
77     # Don't forget to use absolute paths, not relative paths.
78 )
79
80 # List of finder classes that know how to find static files in
81 # various locations.
82 STATICFILES_FINDERS = (
83     'django.contrib.staticfiles.finders.FileSystemFinder',
84     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
85 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
86 )
87
88 # Make this unique, and don't share it with anybody.
89 SECRET_KEY = 'a7np^jzj9=ed17(w(q%z!@gfpu^e0k$99cmto)yon$e06t(leg'
90
91 # List of callables that know how to import templates from various sources.
92 TEMPLATE_LOADERS = (
93     'django.template.loaders.filesystem.Loader',
94     'django.template.loaders.app_directories.Loader',
95 #     'django.template.loaders.eggs.Loader',
96 )
97
98 MIDDLEWARE_CLASSES = (
99     'django.contrib.sessions.middleware.SessionMiddleware',
100     #'django.middleware.locale.LocaleMiddleware',
101     'migdal.middleware.URLLocaleMiddleware',
102
103     'django.middleware.common.CommonMiddleware',
104     'django.middleware.csrf.CsrfViewMiddleware',
105     'django.contrib.auth.middleware.AuthenticationMiddleware',
106     'django.contrib.messages.middleware.MessageMiddleware',
107     # Uncomment the next line for simple clickjacking protection:
108     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
109 )
110
111 ROOT_URLCONF = 'prawokultury.urls'
112
113 # Python dotted path to the WSGI application used by Django's runserver.
114 WSGI_APPLICATION = 'prawokultury.wsgi.application'
115
116 TEMPLATE_DIRS = (
117     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
118     # Always use forward slashes, even on Windows.
119     # Don't forget to use absolute paths, not relative paths.
120 )
121
122 INSTALLED_APPS = (
123     'prawokultury',
124     'events',
125     'migdal',
126
127     'gravatar',
128     'south',
129     'django.contrib.comments',
130     'django_comments_xtd',
131     'pipeline',
132
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     'django.contrib.admindocs',
141 )
142
143 COMMENTS_APP = "django_comments_xtd"
144 COMMENTS_XTD_CONFIRM_EMAIL = False
145
146
147 LANGUAGES = (
148     ('pl', u'polski'),
149     ('en', u'English'),
150 )
151
152
153 # A sample logging configuration. The only tangible logging
154 # performed by this configuration is to send an email to
155 # the site admins on every HTTP 500 error when DEBUG=False.
156 # See http://docs.djangoproject.com/en/dev/topics/logging for
157 # more details on how to customize your logging configuration.
158 LOGGING = {
159     'version': 1,
160     'disable_existing_loggers': False,
161     'filters': {
162         'require_debug_false': {
163             '()': 'django.utils.log.RequireDebugFalse'
164         }
165     },
166     'handlers': {
167         'mail_admins': {
168             'level': 'ERROR',
169             'filters': ['require_debug_false'],
170             'class': 'django.utils.log.AdminEmailHandler'
171         }
172     },
173     'loggers': {
174         'django.request': {
175             'handlers': ['mail_admins'],
176             'level': 'ERROR',
177             'propagate': True,
178         },
179     }
180 }
181
182 STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
183 PIPELINE_CSS_COMPRESSOR = None
184 PIPELINE_JS_COMPRESSOR = None
185 PIPELINE_CSS = {
186     'base': {
187         'source_filenames': (
188           'css/base.css',
189         ),
190         'output_filename': 'compressed/base.css',
191     },
192 }
193
194 TEMPLATE_CONTEXT_PROCESSORS = (
195     "django.contrib.auth.context_processors.auth",
196     "django.core.context_processors.debug",
197     "django.core.context_processors.i18n",
198     "django.core.context_processors.media",
199     "django.core.context_processors.static",
200     "django.core.context_processors.tz",
201     "django.contrib.messages.context_processors.messages",
202     'django.core.context_processors.request',
203 )
204
205 from prawokultury.helpers import textile_pl
206 MARKUP_FIELD_TYPES = (
207     ('textile_pl', textile_pl),
208 )
209 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
210 COMMENTS_XTD_LIST_URL_ACTIVE = True
211 COMMENTS_XTD_LIST_PAGINATE_BY = 10
212