working (and ugly) filtering for resources
[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'Jan Szejko', 'jan.szejko@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     'honeypot',
131     'django_filters',
132
133     'catalogue',
134     # 'cover',
135     'dvcs',
136     'organizations',
137     'wiki',
138     # 'toolbar',
139     # 'apiclient',
140     'email_mangler',
141     'build',
142     'attachments',
143
144     'django_forms_bootstrap',
145     'forms_builder.forms',
146     'fnpdjango',
147 )
148
149 LOGIN_REDIRECT_URL = '/'
150
151 # CAS_USER_ATTRS_MAP = {
152 #     'email': 'email', 'firstname': 'first_name', 'lastname': 'last_name'}
153
154 # REPOSITORY_PATH = '/Users/zuber/Projekty/platforma/files/books'
155
156 IMAGE_DIR = 'images/'
157
158
159 # import djcelery
160 # djcelery.setup_loader()
161
162 BROKER_BACKEND = "djkombu.transport.DatabaseTransport"
163 BROKER_HOST = "localhost"
164 BROKER_PORT = 5672
165 BROKER_USER = "guest"
166 BROKER_PASSWORD = "guest"
167 BROKER_VHOST = "/"
168
169 SHOW_APP_VERSION = False
170
171
172 FORMS_BUILDER_EDITABLE_SLUGS = True
173 FORMS_BUILDER_LABEL_MAX_LENGTH = 2048
174
175 HONEYPOT_FIELD_NAME = 'miut'
176
177 try:
178     from redakcja.settings.compress import *
179 except ImportError:
180     pass