- Added librarian as a submodule.
[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     'suggest',
134 ]
135
136 CACHE_BACKEND = 'locmem:///?max_entries=3000'
137
138 # CSS and JavaScript file groups
139 COMPRESS_CSS = {
140     'all': {
141         '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',),
142         'output_filename': 'css/all.min?.css',
143     },
144     'book': {
145         'source_filenames': ('css/master.book.css',),
146         'output_filename': 'css/book.min?.css',
147     }
148 }
149
150 COMPRESS_JS = {
151     'jquery': {
152         'source_filenames': ('js/jquery.js',),
153         'output_filename': 'js/jquery.min.js',
154     },
155     'all': {
156         'source_filenames': ('js/jquery.autocomplete.js', 'js/jquery.form.js',
157             'js/jquery.countdown.js', 'js/jquery.countdown-pl.js',
158             'js/jquery.countdown-de.js', 'js/jquery.countdown-uk.js',
159             'js/jquery.countdown-es.js', 'js/jquery.countdown-lt.js',
160             'js/jquery.countdown-ru.js', 'js/jquery.countdown-fr.js',
161             'js/jquery.jqmodal.js', 'js/jquery.labelify.js', 'js/catalogue.js',
162             ),
163         'output_filename': 'js/all?.min.js',
164     },
165     'book': {
166         'source_filenames': ('js/jquery.eventdelegation.js', 'js/jquery.scrollto.js', 'js/jquery.highlightfade.js', 'js/book.js',),
167         'output_filename': 'js/book?.min.js',
168     }
169 }
170
171 COMPRESS_VERSION = True
172 COMPRESS_CSS_FILTERS = None
173
174 THUMBNAIL_QUALITY = 95
175 THUMBNAIL_EXTENSION = 'png'
176
177 THUMBNAIL_PROCESSORS = (
178     # Default processors
179     'sorl.thumbnail.processors.colorspace',
180     'sorl.thumbnail.processors.autocrop',
181     'sorl.thumbnail.processors.scale_and_crop',
182     'sorl.thumbnail.processors.filters',
183     # Custom processors
184     'sponsors.processors.add_padding',
185 )
186
187 TRANSLATION_REGISTRY = "wolnelektury.translation"
188
189 # limit number of filtering tags
190 MAX_TAG_LIST = 6
191
192 # Load localsettings, if they exist
193 try:
194     from localsettings import *
195 except ImportError:
196     pass
197