Merge branch 'master' of git@github.com:fnp/wolnelektury
[wolnelektury.git] / wolnelektury / settings.py
1 # -*- coding: utf-8 -*-
2 # Django settings for wolnelektury project.
3 from os import path
4
5 PROJECT_DIR = path.abspath(path.dirname(__file__))
6
7 DEBUG = False
8 TEMPLATE_DEBUG = DEBUG
9 MAINTENANCE_MODE = False
10
11 ADMINS = [
12     # ('Your Name', 'your_email@domain.com'),
13 ]
14
15 MANAGERS = ADMINS
16
17 DATABASE_ENGINE = 'sqlite3'    # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
18 DATABASE_NAME = path.join(PROJECT_DIR, 'dev.db')  # Or path to database file if using sqlite3.
19 DATABASE_USER = ''             # Not used with sqlite3.
20 DATABASE_PASSWORD = ''         # Not used with sqlite3.
21 DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
22 DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.
23
24 # Local time zone for this installation. Choices can be found here:
25 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
26 # although not all choices may be available on all operating systems.
27 # If running in a Windows environment this must be set to the same as your
28 # system time zone.
29 TIME_ZONE = 'Europe/Warsaw Poland'
30
31 # Language code for this installation. All choices can be found here:
32 # http://www.i18nguy.com/unicode/language-identifiers.html
33 LANGUAGE_CODE = 'pl'
34
35 gettext = lambda s: s
36
37 LANGUAGES = tuple(sorted([
38     ('pl', u'polski'),
39     ('de', u'Deutsch'),
40     ('en', u'English'),
41     ('lt', u'lietuvių'),
42     ('fr', u'français'),
43     ('ru', u'русский'),
44     ('es', u'español'),
45     ('uk', u'українська'),
46 ], key=lambda x: x[0]))
47
48
49 SITE_ID = 1
50
51 # If you set this to False, Django will make some optimizations so as not
52 # to load the internationalization machinery.
53 USE_I18N = True
54
55 # Absolute path to the directory that holds media.
56 # Example: "/home/media/media.lawrence.com/"
57 MEDIA_ROOT = path.join(PROJECT_DIR, '../media')
58 STATIC_ROOT = path.join(PROJECT_DIR, 'static')
59
60 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
61 # trailing slash if there is a path component (optional in other cases).
62 # Examples: "http://media.lawrence.com", "http://example.com/media/"
63 MEDIA_URL = '/media/'
64 STATIC_URL = '/static/'
65
66 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
67 # trailing slash.
68 # Examples: "http://foo.com/media/", "/media/".
69 ADMIN_MEDIA_PREFIX = '/admin-media/'
70
71 # Make this unique, and don't share it with anybody.
72
73 # List of callables that know how to import templates from various sources.
74 TEMPLATE_LOADERS = [
75     'django.template.loaders.filesystem.load_template_source',
76     'django.template.loaders.app_directories.load_template_source',
77 #     'django.template.loaders.eggs.load_template_source',
78 ]
79
80 TEMPLATE_CONTEXT_PROCESSORS = [
81     'django.core.context_processors.auth',
82     'django.core.context_processors.debug',
83     'django.core.context_processors.i18n',
84     'django.core.context_processors.media',
85     'django.core.context_processors.request',
86     'wolnelektury.context_processors.extra_settings',
87 ]
88
89 MIDDLEWARE_CLASSES = [
90     'django.middleware.common.CommonMiddleware',
91     'django.contrib.sessions.middleware.SessionMiddleware',
92     'django.contrib.auth.middleware.AuthenticationMiddleware',
93     'django.middleware.doc.XViewMiddleware',
94     'pagination.middleware.PaginationMiddleware',
95     'django.middleware.locale.LocaleMiddleware',
96
97     'maintenancemode.middleware.MaintenanceModeMiddleware',
98 ]
99
100 ROOT_URLCONF = 'wolnelektury.urls'
101
102 TEMPLATE_DIRS = [
103     path.join(PROJECT_DIR, 'templates'),
104 ]
105
106 LOGIN_URL = '/uzytkownicy/zaloguj/'
107
108 LOGIN_REDIRECT_URL = '/'
109
110 INSTALLED_APPS = [
111     # included
112     'django.contrib.auth',
113     'django.contrib.contenttypes',
114     'django.contrib.sessions',
115     'django.contrib.sites',
116     'django.contrib.admin',
117     'django.contrib.admindocs',
118
119     # external
120     'south',
121     'sorl.thumbnail',
122     'sponsors',
123     'newtagging',
124     'pagination',
125     'chunks',
126     'compress',
127     'modeltranslation',
128     'catalogue',
129     'lessons',
130     'piston',
131     'api',
132     'rosetta',
133     'infopages',
134     'suggest',
135 ]
136
137 CACHE_BACKEND = 'locmem:///?max_entries=3000'
138
139 # CSS and JavaScript file groups
140 COMPRESS_CSS = {
141     'all': {
142         'source_filenames': ('css/master.css', 'css/jquery.autocomplete.css', 'css/jquery.countdown.css', 'css/master.plain.css', 'css/sponsors.css', 'css/facelist_2-0.css',),
143         'output_filename': 'css/all.min?.css',
144     },
145     'book': {
146         'source_filenames': ('css/master.book.css',),
147         'output_filename': 'css/book.min?.css',
148     }
149 }
150
151 COMPRESS_JS = {
152     'jquery': {
153         'source_filenames': ('js/jquery.js',),
154         'output_filename': 'js/jquery.min.js',
155     },
156     'all': {
157         'source_filenames': ('js/jquery.autocomplete.js', 'js/jquery.form.js',
158             'js/jquery.countdown.js', 'js/jquery.countdown-pl.js',
159             'js/jquery.countdown-de.js', 'js/jquery.countdown-uk.js',
160             'js/jquery.countdown-es.js', 'js/jquery.countdown-lt.js',
161             'js/jquery.countdown-ru.js', 'js/jquery.countdown-fr.js',
162             'js/jquery.jqmodal.js', 'js/jquery.labelify.js', 'js/catalogue.js',
163             ),
164         'output_filename': 'js/all?.min.js',
165     },
166     'book': {
167         'source_filenames': ('js/jquery.eventdelegation.js', 'js/jquery.scrollto.js', 'js/jquery.highlightfade.js', 'js/book.js',),
168         'output_filename': 'js/book?.min.js',
169     }
170 }
171
172 COMPRESS_VERSION = True
173 COMPRESS_CSS_FILTERS = None
174
175 THUMBNAIL_QUALITY = 95
176 THUMBNAIL_EXTENSION = 'png'
177
178 THUMBNAIL_PROCESSORS = (
179     # Default processors
180     'sorl.thumbnail.processors.colorspace',
181     'sorl.thumbnail.processors.autocrop',
182     'sorl.thumbnail.processors.scale_and_crop',
183     'sorl.thumbnail.processors.filters',
184     # Custom processors
185     'sponsors.processors.add_padding',
186 )
187
188 TRANSLATION_REGISTRY = "wolnelektury.translation"
189
190 # limit number of filtering tags
191 MAX_TAG_LIST = 6
192
193 # Load localsettings, if they exist
194 try:
195     from localsettings import *
196 except ImportError:
197     pass
198