Fixes #3866: Text counter with footnotes.
[redakcja.git] / src / 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 = 'pl'
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
38
39 # Absolute path to the directory that holds media.
40 # Example: "/home/media/media.lawrence.com/"
41 MEDIA_ROOT = PROJECT_ROOT + '/media/dynamic'
42 STATIC_ROOT = PROJECT_ROOT + '/../static/'
43
44 STATICFILES_DIRS = [
45     PROJECT_ROOT + '/static/'
46 ]
47
48 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
49 # trailing slash if there is a path component (optional in other cases).
50 # Examples: "http://media.lawrence.com", "http://example.com/media/"
51 MEDIA_URL = '/media/dynamic/'
52 STATIC_URL = '/media/static/'
53
54 SESSION_COOKIE_NAME = "redakcja_sessionid"
55
56 TEMPLATES = [
57     {
58         'BACKEND': 'django.template.backends.django.DjangoTemplates',
59         'APP_DIRS': True,
60         'DIRS': [
61             PROJECT_ROOT + '/templates',
62         ],
63         'OPTIONS': {
64             'context_processors': [
65                 "django.contrib.auth.context_processors.auth",
66                 "django.template.context_processors.debug",
67                 "django.template.context_processors.i18n",
68                 "redakcja.context_processors.settings", # this is instead of media
69                 'django.template.context_processors.csrf',
70                 "django.template.context_processors.request",
71             ],
72         },
73     },
74 ]
75
76 MIDDLEWARE_CLASSES = (
77     'django.middleware.common.CommonMiddleware',
78     'django.middleware.csrf.CsrfViewMiddleware',
79     'django.contrib.sessions.middleware.SessionMiddleware',
80     'django.contrib.messages.middleware.MessageMiddleware',
81
82     'django.contrib.auth.middleware.AuthenticationMiddleware',
83     'django_cas.middleware.CASMiddleware',
84
85     'django.contrib.admindocs.middleware.XViewMiddleware',
86     'fnp_django_pagination.middleware.PaginationMiddleware',
87     'maintenancemode.middleware.MaintenanceModeMiddleware',
88 )
89
90 AUTHENTICATION_BACKENDS = (
91     'django.contrib.auth.backends.ModelBackend',
92     'fnpdjango.auth_backends.AttrCASBackend',
93 )
94
95 ROOT_URLCONF = 'redakcja.urls'
96
97 FIREPYTHON_LOGGER_NAME = "fnp"
98
99 INSTALLED_APPS = (
100     'django.contrib.auth',
101     'django.contrib.contenttypes',
102     'django.contrib.sessions',
103     'django.contrib.messages',
104     'django.contrib.staticfiles',
105     'django.contrib.sites',
106     'django.contrib.admin',
107     'django.contrib.admindocs',
108     'raven.contrib.django.raven_compat',
109
110     'sorl.thumbnail',
111     'fnp_django_pagination',
112     'django_gravatar',
113     'fileupload',
114     'kombu.transport.django',
115     'pipeline',
116     'fnpdjango',
117
118     'catalogue',
119     'cover',
120     'dvcs',
121     'wiki',
122     'wiki_img',
123     'toolbar',
124     'apiclient',
125     'email_mangler',
126 )
127
128 LOGIN_REDIRECT_URL = '/documents/user'
129
130 CAS_USER_ATTRS_MAP = {
131     'email': 'email', 'firstname': 'first_name', 'lastname': 'last_name'}
132
133 IMAGE_DIR = 'images/'
134
135
136 BROKER_URL = 'django://'
137 CELERY_EAGER_PROPAGATES_EXCEPTIONS = True
138 CELERY_SEND_TASK_ERROR_EMAILS = True
139 CELERY_ACCEPT_CONTENT = ['pickle']  # Remove when all tasks jsonable.
140
141 SHOW_APP_VERSION = False
142
143 MIN_COVER_SIZE = (915, 1270)
144
145 try:
146     from redakcja.settings.compress import *
147 except ImportError:
148     pass
149