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