52752cd9e56953d80bd47c1805b052566a796edc
[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
9 MAINTENANCE_MODE = False
10
11 ADMINS = (
12     (u'Radek Czajka', 'radoslaw.czajka@nowoczesnapolska.org.pl'),
13 )
14
15 MANAGERS = ADMINS
16
17 # Local time zone for this installation. Choices can be found here:
18 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
19 # although not all choices may be available on all operating systems.
20 # If running in a Windows environment this must be set to the same as your
21 # system time zone.
22 TIME_ZONE = 'Europe/Warsaw'
23
24 # Language code for this installation. All choices can be found here:
25 # http://www.i18nguy.com/unicode/language-identifiers.html
26 LANGUAGE_CODE = 'en'
27
28 # import locale
29 # locale.setlocale(locale.LC_ALL, '')
30
31 SITE_ID = 1
32
33 # If you set this to False, Django will make some optimizations so as not
34 # to load the internationalization machinery.
35 USE_I18N = True
36 USE_L10N = True
37 LANGUAGES = [
38     ('en', 'English'),
39     ('pl', 'polski'),
40 ]
41
42 # Absolute path to the directory that holds media.
43 # Example: "/home/media/media.lawrence.com/"
44 MEDIA_ROOT = PROJECT_ROOT + '/media/dynamic'
45 STATIC_ROOT = PROJECT_ROOT + '/../static/'
46
47 STATICFILES_DIRS = [
48     PROJECT_ROOT + '/static/'
49 ]
50
51 LOCALE_PATHS = [
52     PROJECT_ROOT + '/locale/',
53 ]
54
55 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
56 # trailing slash if there is a path component (optional in other cases).
57 # Examples: "http://media.lawrence.com", "http://example.com/media/"
58 MEDIA_URL = '/media/dynamic/'
59 STATIC_URL = '/media/static/'
60
61 SESSION_COOKIE_NAME = "redakcja_sessionid"
62
63 TEMPLATES = [
64     {
65         'BACKEND': 'django.template.backends.django.DjangoTemplates',
66         'DIRS': [
67             os.path.join(PROJECT_ROOT, 'templates'),
68         ],
69         'APP_DIRS': True,
70         'OPTIONS': {
71             'context_processors': [
72                 "django.contrib.auth.context_processors.auth",
73                 "django.template.context_processors.debug",
74                 "django.template.context_processors.i18n",
75                 "redakcja.context_processors.settings",  # this is instead of media
76                 'django.template.context_processors.csrf',
77                 "django.template.context_processors.request",
78             ],
79         },
80     },
81 ]
82
83 MIDDLEWARE_CLASSES = (
84     'django.middleware.common.CommonMiddleware',
85     'django.middleware.csrf.CsrfViewMiddleware',
86     'django.contrib.sessions.middleware.SessionMiddleware',
87     'django.contrib.messages.middleware.MessageMiddleware',
88     'django.middleware.locale.LocaleMiddleware',
89
90     'django.contrib.auth.middleware.AuthenticationMiddleware',
91     # 'django_cas.middleware.CASMiddleware',
92
93     'django.contrib.admindocs.middleware.XViewMiddleware',
94     'fnp_django_pagination.middleware.PaginationMiddleware',
95     # 'maintenancemode.middleware.MaintenanceModeMiddleware',
96     'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
97 )
98
99 # AUTHENTICATION_BACKENDS = (
100 #     'django.contrib.auth.backends.ModelBackend',
101 #     'fnpdjango.auth_backends.AttrCASBackend',
102 # )
103
104 ROOT_URLCONF = 'redakcja.urls'
105
106 FIREPYTHON_LOGGER_NAME = "fnp"
107
108 INSTALLED_APPS = (
109     'django.contrib.auth',
110     'django.contrib.contenttypes',
111     'django.contrib.sessions',
112     'django.contrib.messages',
113     'django.contrib.staticfiles',
114     'django.contrib.sites',
115     'django.contrib.admin',
116     'django.contrib.admindocs',
117     'django.contrib.flatpages',
118     # 'django.contrib.comments',
119
120     # 'south',
121     'sorl.thumbnail',
122     'fnp_django_pagination',
123     # 'gravatar',
124     # 'kombu.transport.django',
125     'fileupload',
126     'pipeline',
127     'modeltranslation',
128     'constance',
129     'constance.backends.database',
130
131     'catalogue',
132     # 'cover',
133     'dvcs',
134     'organizations',
135     'wiki',
136     # 'toolbar',
137     # 'apiclient',
138     'email_mangler',
139     'build',
140     'attachments',
141
142     'django_forms_bootstrap',
143     'forms_builder.forms',
144     'fnpdjango',
145 )
146
147 LOGIN_REDIRECT_URL = '/'
148
149 # CAS_USER_ATTRS_MAP = {
150 #     'email': 'email', 'firstname': 'first_name', 'lastname': 'last_name'}
151
152 # REPOSITORY_PATH = '/Users/zuber/Projekty/platforma/files/books'
153
154 IMAGE_DIR = 'images/'
155
156
157 # import djcelery
158 # djcelery.setup_loader()
159
160 BROKER_BACKEND = "djkombu.transport.DatabaseTransport"
161 BROKER_HOST = "localhost"
162 BROKER_PORT = 5672
163 BROKER_USER = "guest"
164 BROKER_PASSWORD = "guest"
165 BROKER_VHOST = "/"
166
167 SHOW_APP_VERSION = False
168
169
170 FORMS_BUILDER_EDITABLE_SLUGS = True
171 FORMS_BUILDER_LABEL_MAX_LENGTH = 2048
172
173
174 try:
175     from redakcja.settings.compress import *
176 except ImportError:
177     pass