VStorage now looks for <doc> if it couldn't find <doc>.xml
[redakcja.git] / redakcja / settings / common.py
1 # -*- coding: utf-8 -*-
2 import os.path
3
4 PROJECT_ROOT = os.path.realpath(os.path.dirname(os.path.dirname(__file__)))
5
6 DEBUG = False
7 TEMPLATE_DEBUG = DEBUG
8
9 MAINTENANCE_MODE = False
10
11 ADMINS = (
12     # (u'Marek Stępniowski', 'marek@stepniowski.com'),
13     (u'Łukasz Rekucki', 'lrekucki@gmail.com'),
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
38 # Absolute path to the directory that holds media.
39 # Example: "/home/media/media.lawrence.com/"
40 MEDIA_ROOT = PROJECT_ROOT + '/media/dynamic'
41 STATIC_ROOT = PROJECT_ROOT + '/static/'
42
43 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
44 # trailing slash if there is a path component (optional in other cases).
45 # Examples: "http://media.lawrence.com", "http://example.com/media/"
46 MEDIA_URL = '/media/dynamic/'
47 STATIC_URL = '/media/static/'
48
49 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
50 # trailing slash.
51 # Examples: "http://foo.com/media/", "/media/".
52 ADMIN_MEDIA_PREFIX = '/media/admin-media/'
53
54 # Make this unique, and don't share it with anybody.
55 SECRET_KEY = 'ife@x^_lak+x84=lxtr!-ur$5g$+s6xt85gbbm@e_fk6q3r8=+'
56 SESSION_COOKIE_NAME = "redakcja_sessionid"
57
58 # List of callables that know how to import templates from various sources.
59 TEMPLATE_LOADERS = (
60     'django.template.loaders.filesystem.load_template_source',
61     'django.template.loaders.app_directories.load_template_source',
62 #     'django.template.loaders.eggs.load_template_source',
63 )
64
65 TEMPLATE_CONTEXT_PROCESSORS = (
66     "django.core.context_processors.auth",
67     "django.core.context_processors.debug",
68     "django.core.context_processors.i18n",
69     "redakcja.context_processors.settings", # this is instead of media 
70     "django.core.context_processors.request",
71 )
72
73
74 MIDDLEWARE_CLASSES = (
75     'django.middleware.common.CommonMiddleware',
76     'django.contrib.sessions.middleware.SessionMiddleware',
77
78     'django.contrib.auth.middleware.AuthenticationMiddleware',
79     'django_cas.middleware.CASMiddleware',
80
81     'django.middleware.doc.XViewMiddleware',
82     'maintenancemode.middleware.MaintenanceModeMiddleware',
83 )
84
85 AUTHENTICATION_BACKENDS = (
86     'django.contrib.auth.backends.ModelBackend',
87     'django_cas.backends.CASBackend',
88 )
89
90 ROOT_URLCONF = 'redakcja.urls'
91
92 TEMPLATE_DIRS = (
93     PROJECT_ROOT + '/templates',
94 )
95
96 FIREPYTHON_LOGGER_NAME = "fnp"
97
98 #
99 # Central Auth System
100 #
101 ## Set this to where the CAS server lives
102 # CAS_SERVER_URL = "http://cas.fnp.pl/
103 CAS_LOGOUT_COMPLETELY = True
104
105 from compress_settings import *
106
107 INSTALLED_APPS = (
108     'django.contrib.auth',
109     'django.contrib.contenttypes',
110     'django.contrib.sessions',
111     'django.contrib.sites',
112     'django.contrib.admin',
113     'django.contrib.admindocs',
114
115     'django_cas',
116     'compress',
117     'south',
118     'sorl.thumbnail',
119     'filebrowser',
120
121     'wiki',
122     'toolbar',
123 )
124
125 FILEBROWSER_URL_FILEBROWSER_MEDIA = STATIC_URL + 'filebrowser/'
126 FILEBROWSER_DIRECTORY = 'images/'
127 FILEBROWSER_ADMIN_VERSIONS = []
128 FILEBROWSER_VERSIONS_BASEDIR = 'thumbnails/'
129 FILEBROWSER_DEFAULT_ORDER = "path_relative"
130
131 # REPOSITORY_PATH = '/Users/zuber/Projekty/platforma/files/books'
132 IMAGE_DIR = 'images'
133
134
135 WL_API_CONFIG = {
136     "URL": "http://localhost:7000/api/",
137     "AUTH_REALM": "WL API",
138     "AUTH_USER": "platforma",
139     "AUTH_PASSWD": "platforma",
140 }
141
142 # Import localsettings file, which may override settings defined here
143
144 from localsettings import *
145
146 try:
147     import logging
148     if os.path.isfile(LOGGING_CONFIG_FILE):
149         import logging.config
150         logging.config.fileConfig(LOGGING_CONFIG_FILE)
151     else:
152         import sys
153         logging.basicConfig(stream=sys.stderr)
154 except ImportError as exc:
155     raise