Added LOGIN_URL parameter
[e_cidadania.git] / src / e_cidadania / settings / defaults.py
blob396e3d9bbf57acb5b480f82aa81e33be1dae57d5
1 # -*- coding: utf-8 -*-
3 # Copyright (c) 2013 Clione Software
4 # Copyright (c) 2010-2013 Cidadania S. Coop. Galega
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 """
19 Default settings for the e-cidadania project. This settings can be overriden by
20 the development and production files. They also can add new settings to this file.
22 Plase refer to the 'configuration' section of the documentation for guidance.
23 """
25 import os
27 # e-cidadania version and current status
28 __version__ = "0.1.9"
29 __status__ = "beta"
31 # Get the current working directory so we can fill automatically other variables.
32 cwd = os.path.dirname(os.path.realpath(__file__)).strip('settings')
33 #print "Current working dir: %s" % cwd
35 # Extending the user profile a bit more
36 AUTH_PROFILE_MODULE = "accounts.UserProfile"
37 ACCOUNT_ACTIVATION_DAYS = 2
38 LOGIN_REDIRECT_URL = '/accounts/'
39 LOGIN_URL = '/accounts/'
40 ANONYMOUS_USER_ID = -1
41 GUARDIAN_RENDER_403 = True
43 # Languages for the platform.
44 LANGUAGES = (
45 ('es_ES', 'Español'),
46 ('en_GB', 'English'),
47 ('gl_ES', 'Galego'),
48 ('fr_FR', 'Français'),
49 ('mk_MK', 'Makedonski'),
50 ('pt_BR', 'Português'),
51 ('hi_IN', 'Hindi'),
54 LOCALE_PATHS = (
55 cwd + '/templates/locale',
58 SITE_ID = 1
59 USE_I18N = True
60 USE_L10N = True
62 # Calendar
63 FIRST_WEEK_DAY = 0 # '0' for Monday, '6' for Sunday
65 # Configuration related to media and static content directories
66 MEDIA_ROOT = cwd + '/uploads/'
67 # print "Media root: %s" % MEDIA_ROOT
68 MEDIA_URL = '/uploads/'
69 STATIC_ROOT = cwd + '/static/'
70 # print "Static root: %s" % STATIC_ROOT
71 STATIC_URL = '/static/'
72 ADMIN_MEDIA_PREFIX = STATIC_URL
74 STATICFILES_FINDERS = (
75 'django.contrib.staticfiles.finders.FileSystemFinder',
76 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
77 #'django.contrib.staticfiles.finders.DefaultStorageFinder',
80 STATICFILES_DIRS = (
81 (cwd + '/static_files/'),
84 FILE_UPLOAD_HANDLERS = (
85 "django.core.files.uploadhandler.MemoryFileUploadHandler",
86 "django.core.files.uploadhandler.TemporaryFileUploadHandler",
89 # Make this unique, and don't share it with anybody.
90 SECRET_KEY = '8nwcwmtau*bnu0u=shmdkda^-tpn55ch%qeqc8xn#-77r8c*0a'
92 # List of callables that know how to import templates from various sources.
93 TEMPLATE_LOADERS = (
94 'django.template.loaders.filesystem.Loader',
95 'django.template.loaders.app_directories.Loader',
96 #'django.template.loaders.eggs.Loader',
99 TEMPLATE_CONTEXT_PROCESSORS = (
100 "django.contrib.auth.context_processors.auth",
101 "django.core.context_processors.debug",
102 "django.core.context_processors.i18n",
103 "django.core.context_processors.media",
104 "django.core.context_processors.static",
105 "django.contrib.messages.context_processors.messages",
106 "django.core.context_processors.request",
109 MIDDLEWARE_CLASSES = (
110 # GZipMiddleware compresses content for modern browsers
111 'django.middleware.gzip.GZipMiddleware',
112 # ConditionalGetMiddleware adds support for modern browsers to conditionaly
113 # GET responses
114 'django.middleware.http.ConditionalGetMiddleware',
115 'django.middleware.common.CommonMiddleware',
116 'django.contrib.sessions.middleware.SessionMiddleware',
117 'django.middleware.csrf.CsrfViewMiddleware',
118 'django.contrib.auth.middleware.AuthenticationMiddleware',
119 'django.contrib.messages.middleware.MessageMiddleware',
120 'django.middleware.locale.LocaleMiddleware',
121 #'debug_toolbar.middleware.DebugToolbarMiddleware',
124 AUTHENTICATION_BACKENDS = (
125 'django.contrib.auth.backends.ModelBackend', # this is default
126 'guardian.backends.ObjectPermissionBackend',
129 ROOT_URLCONF = 'e_cidadania.urls'
130 APPEND_SLASH = True
132 TEMPLATE_DIRS = (
133 (cwd + '/templates'),
136 # We separate the applications so we can manage them through scripts
137 # Please do not touch this unless you know very well what you're doing
139 DJANGO_APPS = (
140 # This list is from the builtin applications in django that are used in
141 # e-cidadania
142 'core.prismriver',
143 'django.contrib.auth',
144 'django.contrib.contenttypes',
145 'django.contrib.sessions',
146 'django.contrib.staticfiles',
147 'django.contrib.sites',
148 'django.contrib.messages',
149 'django.contrib.comments',
150 'django.contrib.admin',
151 'django.contrib.comments',
154 # Stablish message storage
155 MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage'
157 THIRDPARTY_APPS = (
158 # This list is from the third party software included in e-cidadania or
159 # system-wide dependencies.
160 'apps.thirdparty.smart_selects',
161 'apps.thirdparty.userprofile',
162 'apps.thirdparty.tagging',
163 'guardian',
164 'south',
167 ECIDADANIA_MODULES = (
168 # Modules created for e-cidadania and installed by default. You can add
169 # here your own modules
170 'core.spaces',
171 'apps.ecidadania.accounts',
172 'apps.ecidadania.proposals',
173 'apps.ecidadania.news',
174 'apps.ecidadania.debate',
175 'apps.ecidadania.staticpages',
176 'apps.ecidadania.cal',
177 'extras.custom_stuff',
178 'apps.ecidadania.voting',
179 'apps.ecidadania.api',
180 'apps.ecidadania.reports',
183 # A sample logging configuration. The only tangible logging
184 # performed by this configuration is to send an email to
185 # the site admins on every HTTP 500 error.
186 # See http://docs.djangoproject.com/en/dev/topics/logging for
187 # more details on how to customize your logging configuration.
188 LOGGING = {
189 'version': 1,
190 'disable_existing_loggers': False,
191 'filters': {
192 'require_debug_false': {
193 '()': 'django.utils.log.RequireDebugFalse'
196 'handlers': {
197 'mail_admins': {
198 'level': 'ERROR',
199 'filters': ['require_debug_false'],
200 'class': 'django.utils.log.AdminEmailHandler'
203 'loggers': {
204 'django.request': {
205 'handlers': ['mail_admins'],
206 'level': 'ERROR',
207 'propagate': True,
212 # Combine all the apps in the django variable INSTALLED_APPS
213 INSTALLED_APPS = DJANGO_APPS + THIRDPARTY_APPS + ECIDADANIA_MODULES
215 # Activate the new url syntax in django 1.3 which will be
216 # compatible till 1.5
217 # import django.template
218 # django.template.add_to_builtins('django.templatetags.future')