Fix gallery merging: support for None offsets
[redakcja.git] / redakcja / settings / common.py
1 # -*- coding: utf-8 -*-
2 from __future__ import absolute_import
3 import os.path
4
5 PROJECT_ROOT = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
6
7 DEBUG = False
8 TEMPLATE_DEBUG = DEBUG
9
10 MAINTENANCE_MODE = False
11
12 ADMINS = (
13     (u'Radek Czajka', 'radoslaw.czajka@nowoczesnapolska.org.pl'),
14 )
15
16 MANAGERS = ADMINS
17
18 # Local time zone for this installation. Choices can be found here:
19 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
20 # although not all choices may be available on all operating systems.
21 # If running in a Windows environment this must be set to the same as your
22 # system time zone.
23 TIME_ZONE = 'Europe/Warsaw'
24
25 # Language code for this installation. All choices can be found here:
26 # http://www.i18nguy.com/unicode/language-identifiers.html
27 LANGUAGE_CODE = 'pl'
28
29 #import locale
30 #locale.setlocale(locale.LC_ALL, '')
31
32 SITE_ID = 1
33
34 # If you set this to False, Django will make some optimizations so as not
35 # to load the internationalization machinery.
36 USE_I18N = True
37 USE_L10N = True
38
39
40 # Absolute path to the directory that holds media.
41 # Example: "/home/media/media.lawrence.com/"
42 MEDIA_ROOT = PROJECT_ROOT + '/media/dynamic'
43 STATIC_ROOT = PROJECT_ROOT + '/static/'
44
45 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
46 # trailing slash if there is a path component (optional in other cases).
47 # Examples: "http://media.lawrence.com", "http://example.com/media/"
48 MEDIA_URL = '/media/dynamic/'
49 STATIC_URL = '/media/static/'
50
51 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
52 # trailing slash.
53 # Examples: "http://foo.com/media/", "/media/".
54 ADMIN_MEDIA_PREFIX = '/media/admin-media/'
55
56 # Make this unique, and don't share it with anybody.
57 SECRET_KEY = 'ife@x^_lak+x84=lxtr!-ur$5g$+s6xt85gbbm@e_fk6q3r8=+'
58 SESSION_COOKIE_NAME = "redakcja_sessionid"
59
60 # List of callables that know how to import templates from various sources.
61 TEMPLATE_LOADERS = (
62     'django.template.loaders.filesystem.Loader',
63     'django.template.loaders.app_directories.Loader',
64 )
65
66 TEMPLATE_CONTEXT_PROCESSORS = (
67     "django.contrib.auth.context_processors.auth",
68     "django.core.context_processors.debug",
69     "django.core.context_processors.i18n",
70     "redakcja.context_processors.settings", # this is instead of media
71     'django.core.context_processors.csrf',
72     "django.core.context_processors.request",
73 )
74
75
76 MIDDLEWARE_CLASSES = (
77     'django.middleware.common.CommonMiddleware',
78     'django.middleware.csrf.CsrfViewMiddleware',
79     'django.contrib.sessions.middleware.SessionMiddleware',
80
81     'django.contrib.auth.middleware.AuthenticationMiddleware',
82     'django_cas.middleware.CASMiddleware',
83
84     'django.middleware.doc.XViewMiddleware',
85     'pagination.middleware.PaginationMiddleware',
86     'maintenancemode.middleware.MaintenanceModeMiddleware',
87 )
88
89 AUTHENTICATION_BACKENDS = (
90     'django.contrib.auth.backends.ModelBackend',
91     'django_cas.backends.CASBackend',
92 )
93
94 ROOT_URLCONF = 'redakcja.urls'
95
96 TEMPLATE_DIRS = (
97     PROJECT_ROOT + '/templates',
98 )
99
100 FIREPYTHON_LOGGER_NAME = "fnp"
101
102 INSTALLED_APPS = (
103     'django.contrib.auth',
104     'django.contrib.contenttypes',
105     'django.contrib.sessions',
106     'django.contrib.sites',
107     'django.contrib.admin',
108     'django.contrib.admindocs',
109     'django.contrib.comments',
110
111     'compress',
112     'south',
113     'sorl.thumbnail',
114     'filebrowser',
115     'pagination',
116     'gravatar',
117     'djcelery',
118     'djkombu',
119
120     'catalogue',
121     'cover',
122     'dvcs',
123     'wiki',
124     'toolbar',
125     'apiclient',
126     'email_mangler',
127 )
128
129 LOGIN_REDIRECT_URL = '/documents/user'
130
131 CAS_USER_ATTRS_MAP = {
132     'email': 'email', 'firstname': 'first_name', 'lastname': 'last_name'}
133
134
135 FILEBROWSER_URL_FILEBROWSER_MEDIA = STATIC_URL + 'filebrowser/'
136 FILEBROWSER_DIRECTORY = 'images/'
137 FILEBROWSER_ADMIN_VERSIONS = []
138 FILEBROWSER_VERSIONS_BASEDIR = 'thumbnails/'
139 FILEBROWSER_DEFAULT_ORDER = "path_relative"
140
141 # REPOSITORY_PATH = '/Users/zuber/Projekty/platforma/files/books'
142
143 # Must match FILEBROWSER_DIRECTORY
144 IMAGE_DIR = 'images'
145
146
147 import djcelery
148 djcelery.setup_loader()
149
150 BROKER_BACKEND = "djkombu.transport.DatabaseTransport"
151 BROKER_HOST = "localhost"
152 BROKER_PORT = 5672
153 BROKER_USER = "guest"
154 BROKER_PASSWORD = "guest"
155 BROKER_VHOST = "/"
156
157 SHOW_APP_VERSION = False
158
159 try:
160     from redakcja.settings.compress import *
161 except ImportError:
162     pass
163