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