-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.py
288 lines (252 loc) · 7.8 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# -*- coding: utf-8 -*-
import os
gettext = lambda s: s
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Martín Fuentes', '[email protected]'),
('Antonio Barcia', '[email protected]'),
('Javi Fuentes', '[email protected]'),
)
MANAGERS = ADMINS
LANGUAGES = (
('es', gettext('Spanish')),
('en', gettext('English')),
('it', gettext('Italiano')),
('fr', gettext(u'Français')),
)
DEFAULT_LANGUAGE = 0
CMS_LANGUAGES = {
1: [
{
'code': 'es',
'name': gettext('Spanish'),
'fallbacks': ['en'],
},
{
'code': 'en',
'name': gettext(u'English'),
},
{
'code': 'it',
'name': gettext(u'Italiano'),
'public': False
},
{
'code': 'fr',
'name': gettext(u'Français'),
},
],
"default": {
'public': True,
'hide_untranslated': False,
'redirect_on_fallback': False
}
}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PROJECT_DIR, 'mycms.db'),
}
}
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Europe/Madrid'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
LOCALE_PATHS = (os.path.join(PROJECT_DIR, 'locale'),)
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/"
MEDIA_ROOT = '/var/www/lifecubomed/media/'
STATIC_ROOT = '/var/www/lifecubomed/static/'
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash if there is a path component (optional in other cases).
# Examples: "http://media.lawrence.com", "http://example.com/media/"
MEDIA_URL = '/media/'
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(os.path.abspath(os.path.dirname(__file__)), "static/"),
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = '0r6%7gip5tmez*vygfv+u14h@4lbt^8e2^26o#5_f_#b7%cm)u'
TEMPLATE_DIRS = (
os.path.join(PROJECT_DIR, 'templates'),
)
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.middleware.common.CommonMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware',
'accounts.middleware.RemoveNextMiddleware',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.i18n',
'django.core.context_processors.request',
'django.core.context_processors.media',
'django.core.context_processors.static',
'cms.context_processors.media',
'sekizai.context_processors.sekizai',
)
CMS_TEMPLATES = (
('home.html', gettext('Home Template')),
('page.html', gettext('Page Template')),
('new.html', gettext('New Template')),
('news.html', gettext('Cubomed News Template')),
('contact.html', gettext('Contact Template')),
('page2c.html', gettext('Page Template 2 colum')),
('page2.html', gettext('Page Template special')),
('page3c.html', gettext('Page template 3 colum')),
('page3cb.html', gettext('Page template 3 colum esp')),
('page3cnews.html', gettext('Page template 3 colum news')),
('sightings_page.html', gettext( 'Sightings Page Template')),
('registration/login.html', gettext('Accounts login template')),
('registration/registration_form.html', gettext('Accounts registration template')),
('sighting_report_form.html', gettext('Sight report template')),
)
CMS_PLACEHOLDER_CONF = {
'new-image': {
'plugins': ['PicturePlugin'],
'name':gettext("Picture"),
},
'new-text': {
'plugins': ['TextPlugin'],
'name':gettext("Text and Link"),
},
'new-text-and-link': {
'plugins': ['TextPlugin', 'LinkPlugin'],
'name':gettext("New #2 Text"),
},
}
ROOT_URLCONF = 'urls'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.staticfiles',
'cms',
'menus',
'mptt',
'south',
'cms.plugins.text',
'cms.plugins.picture',
'cms.plugins.link',
'cms.plugins.file',
'cms.plugins.snippet',
'cms.plugins.googlemap',
'cms.plugins.inherit',
'sekizai',
'django_extensions',
'cmsplugin_embeddedpages',
'filer',
'cmsplugin_contact',
'imagestore',
'sorl.thumbnail',
'tagging',
'imagestore.imagestore_cms',
'tinymce',
'cmsplugin_flickr_slideshow',
'cmsplugin_gallery',
'cmsplugin_youtube',
'cms.plugins.flash',
'accounts',
'accounts.login',
'accounts.register',
'registration',
'sightings',
'sightings.report'
)
# Imagestore settings
IMAGESTORE_SHOW_USER = False
# Registration/auth settings
ACCOUNT_ACTIVATION_DAYS = 7
LOGFILE = os.path.join(PROJECT_DIR, "logfile.log")
try:
from local_settings import *
except ImportError:
pass
if DEBUG:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'null': {
'level': 'DEBUG',
'class': 'django.utils.log.NullHandler',
},
'console':{
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
'logfile': {
'level':'DEBUG',
'class':'logging.handlers.RotatingFileHandler',
'filename': LOGFILE,
'maxBytes': 50000,
'backupCount': 2,
'formatter': 'verbose',
},
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler',
}
},
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'loggers': {
'django': {
'handlers': ['logfile'],
'propagate': True,
'level': 'INFO',
},
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
CMS_YOUTUBE_DEFAULT_AUTOPLAY = False