Merge branch 'production'
[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     ('de', gettext('German')),
38     ('en', gettext('English')),
39     ('pl', gettext('Polish')),
40     ('lt', gettext('Lithuanian')),
41     ('fr', gettext('French')),
42     ('ru', gettext('Russian')),
43     ('es', gettext('Spanish')),        
44 )
45
46
47 SITE_ID = 1
48
49 # If you set this to False, Django will make some optimizations so as not
50 # to load the internationalization machinery.
51 USE_I18N = True
52
53 # Absolute path to the directory that holds media.
54 # Example: "/home/media/media.lawrence.com/"
55 MEDIA_ROOT = path.join(PROJECT_DIR, '../media')
56 STATIC_ROOT = path.join(PROJECT_DIR, 'static')
57
58 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
59 # trailing slash if there is a path component (optional in other cases).
60 # Examples: "http://media.lawrence.com", "http://example.com/media/"
61 MEDIA_URL = '/media/'
62 STATIC_URL = '/static/'
63
64 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
65 # trailing slash.
66 # Examples: "http://foo.com/media/", "/media/".
67 ADMIN_MEDIA_PREFIX = '/admin-media/'
68
69 # Make this unique, and don't share it with anybody.
70
71 # List of callables that know how to import templates from various sources.
72 TEMPLATE_LOADERS = [
73     'django.template.loaders.filesystem.load_template_source',
74     'django.template.loaders.app_directories.load_template_source',
75 #     'django.template.loaders.eggs.load_template_source',
76 ]
77
78 TEMPLATE_CONTEXT_PROCESSORS = [
79     'django.core.context_processors.auth',
80     'django.core.context_processors.debug',
81     'django.core.context_processors.i18n',
82     'django.core.context_processors.media',
83     'django.core.context_processors.request',
84     'wolnelektury.context_processors.extra_settings',
85 ]
86
87 MIDDLEWARE_CLASSES = [
88     'django.middleware.common.CommonMiddleware',
89     'django.contrib.sessions.middleware.SessionMiddleware',
90     'django.contrib.auth.middleware.AuthenticationMiddleware',
91     'django.middleware.doc.XViewMiddleware',
92     'pagination.middleware.PaginationMiddleware',
93     'django.middleware.locale.LocaleMiddleware',
94
95     'maintenancemode.middleware.MaintenanceModeMiddleware',
96 ]
97
98 ROOT_URLCONF = 'wolnelektury.urls'
99
100 TEMPLATE_DIRS = [
101     path.join(PROJECT_DIR, 'templates'),
102 ]
103
104 LOGIN_URL = '/uzytkownicy/zaloguj/'
105
106 LOGIN_REDIRECT_URL = '/'
107
108 INSTALLED_APPS = [
109     # included
110     'django.contrib.auth',
111     'django.contrib.contenttypes',
112     'django.contrib.sessions',
113     'django.contrib.sites',
114     'django.contrib.admin',
115     'django.contrib.admindocs',
116
117     # external
118     'south',
119     'sorl.thumbnail',
120     'sponsors',
121     'newtagging',
122     'pagination',
123     'chunks',
124     'compress',
125     'catalogue',
126     'lessons',
127     'piston',
128     'api',
129     'rosetta',
130 ]
131
132 CACHE_BACKEND = 'locmem:///?max_entries=3000'
133
134 # CSS and JavaScript file groups
135 COMPRESS_CSS = {
136     'all': {
137         'source_filenames': ('css/master.css', 'css/jquery.autocomplete.css', 'css/jquery.countdown.css', 'css/master.plain.css', 'css/sponsors.css',),
138         'output_filename': 'css/all.min?.css',
139     },
140     'book': {
141         'source_filenames': ('css/master.book.css',),
142         'output_filename': 'css/book.min?.css',
143     }
144 }
145
146 COMPRESS_JS = {
147     'jquery': {
148         'source_filenames': ('js/jquery.js',),
149         'output_filename': 'js/jquery.min.js',
150     },
151     'all': {
152         'source_filenames': ('js/jquery.autocomplete.js', 'js/jquery.form.js', 
153             'js/jquery.countdown.js', 'js/jquery.countdown-pl.js', 
154             'js/jquery.countdown-de.js',
155             'js/jquery.countdown-es.js', 'js/jquery.countdown-lt.js',
156             'js/jquery.countdown-ru.js', 'js/jquery.countdown-fr.js',
157             'js/jquery.jqmodal.js', 'js/jquery.labelify.js', 'js/catalogue.js',
158             'js/jquery.cookie.js',),
159         'output_filename': 'js/all?.min.js',
160     },
161     'book': {
162         'source_filenames': ('js/jquery.eventdelegation.js', 'js/jquery.scrollto.js', 'js/jquery.highlightfade.js', 'js/book.js',),
163         'output_filename': 'js/book?.min.js',
164     }
165 }
166
167 COMPRESS_VERSION = True
168 COMPRESS_CSS_FILTERS = None
169
170 THUMBNAIL_QUALITY = 95
171 THUMBNAIL_EXTENSION = 'png'
172
173 THUMBNAIL_PROCESSORS = (
174     # Default processors
175     'sorl.thumbnail.processors.colorspace',
176     'sorl.thumbnail.processors.autocrop',
177     'sorl.thumbnail.processors.scale_and_crop',
178     'sorl.thumbnail.processors.filters',
179     # Custom processors
180     'sponsors.processors.add_padding',
181 )
182
183 # Load localsettings, if they exist
184 try:
185     from localsettings import *
186 except ImportError:
187     pass
188