e2a0a2d919ad4f2b5abde50af505d4eb887d39e5
[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 = 'en'
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 LANGUAGES = [
39     ('en', 'English'),
40     ('pl', 'polski'),
41 ]
42
43 # Absolute path to the directory that holds media.
44 # Example: "/home/media/media.lawrence.com/"
45 MEDIA_ROOT = PROJECT_ROOT + '/media/dynamic'
46 STATIC_ROOT = PROJECT_ROOT + '/../static/'
47
48 STATICFILES_DIRS = [
49     PROJECT_ROOT + '/static/'
50 ]
51
52 LOCALE_PATHS = [
53     PROJECT_ROOT + '/locale/',
54 ]
55
56 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
57 # trailing slash if there is a path component (optional in other cases).
58 # Examples: "http://media.lawrence.com", "http://example.com/media/"
59 MEDIA_URL = '/media/dynamic/'
60 STATIC_URL = '/media/static/'
61
62 SESSION_COOKIE_NAME = "redakcja_sessionid"
63
64 # List of callables that know how to import templates from various sources.
65 TEMPLATE_LOADERS = (
66     'django.template.loaders.filesystem.Loader',
67     'django.template.loaders.app_directories.Loader',
68 )
69
70 TEMPLATE_CONTEXT_PROCESSORS = (
71     "django.contrib.auth.context_processors.auth",
72     "django.core.context_processors.debug",
73     "django.core.context_processors.i18n",
74     "redakcja.context_processors.settings",  # this is instead of media
75     'django.core.context_processors.csrf',
76     "django.core.context_processors.request",
77 )
78
79
80 MIDDLEWARE_CLASSES = (
81     'django.middleware.common.CommonMiddleware',
82     'django.middleware.csrf.CsrfViewMiddleware',
83     'django.contrib.sessions.middleware.SessionMiddleware',
84     'django.contrib.messages.middleware.MessageMiddleware',
85     'django.middleware.locale.LocaleMiddleware',
86
87     'django.contrib.auth.middleware.AuthenticationMiddleware',
88     # 'django_cas.middleware.CASMiddleware',
89
90     'django.contrib.admindocs.middleware.XViewMiddleware',
91     'pagination.middleware.PaginationMiddleware',
92     # 'maintenancemode.middleware.MaintenanceModeMiddleware',
93     'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
94 )
95
96 # AUTHENTICATION_BACKENDS = (
97 #     'django.contrib.auth.backends.ModelBackend',
98 #     'fnpdjango.auth_backends.AttrCASBackend',
99 # )
100
101 ROOT_URLCONF = 'redakcja.urls'
102
103 TEMPLATE_DIRS = (
104     PROJECT_ROOT + '/templates',
105 )
106
107 FIREPYTHON_LOGGER_NAME = "fnp"
108
109 INSTALLED_APPS = (
110     'django.contrib.auth',
111     'django.contrib.contenttypes',
112     'django.contrib.sessions',
113     'django.contrib.messages',
114     'django.contrib.staticfiles',
115     'django.contrib.sites',
116     'django.contrib.admin',
117     'django.contrib.admindocs',
118     'django.contrib.flatpages',
119     # 'django.contrib.comments',
120
121     # 'south',
122     'sorl.thumbnail',
123     'pagination',
124     # 'gravatar',
125     # 'kombu.transport.django',
126     'fileupload',
127     'pipeline',
128     'modeltranslation',
129     'constance',
130     'constance.backends.database',
131
132     'catalogue',
133     # 'cover',
134     'dvcs',
135     'organizations',
136     'wiki',
137     # 'toolbar',
138     # 'apiclient',
139     'email_mangler',
140     'build',
141     'attachments',
142
143     'django_forms_bootstrap',
144     'forms_builder.forms',
145     'fnpdjango',
146 )
147
148 LOGIN_REDIRECT_URL = '/'
149
150 # CAS_USER_ATTRS_MAP = {
151 #     'email': 'email', 'firstname': 'first_name', 'lastname': 'last_name'}
152
153 # REPOSITORY_PATH = '/Users/zuber/Projekty/platforma/files/books'
154
155 IMAGE_DIR = 'images/'
156
157
158 # import djcelery
159 # djcelery.setup_loader()
160
161 BROKER_BACKEND = "djkombu.transport.DatabaseTransport"
162 BROKER_HOST = "localhost"
163 BROKER_PORT = 5672
164 BROKER_USER = "guest"
165 BROKER_PASSWORD = "guest"
166 BROKER_VHOST = "/"
167
168 SHOW_APP_VERSION = False
169
170
171 FORMS_BUILDER_EDITABLE_SLUGS = True
172 FORMS_BUILDER_LABEL_MAX_LENGTH = 2048
173
174
175 try:
176     from redakcja.settings.compress import *
177 except ImportError:
178     pass