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