This repository has been archived by the owner on Jun 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.py
298 lines (250 loc) · 9.44 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
289
290
291
292
293
294
295
296
297
298
# -*- coding: utf-8 -*-
# Django settings for AndaluciaPeople project.
'''
andaluciapeople.com
Copyright (C) 2008-2009 Manuel Martín Salvador <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
from os import path
import re
DEBUG = True
TEMPLATE_DEBUG = DEBUG
BASEDIR = path.dirname(path.abspath(__file__))
BASEURL = 'http://127.0.0.1:8000/'
ADMINS = (
('Administrador', '<EMAIL>'),
)
MANAGERS = ADMINS
BUG_EMAIL = '<EMAIL>'
EMAIL = '<EMAIL>'
DEFAULT_FROM_EMAIL = EMAIL
EMAIL_USE_TLS = True
EMAIL_HOST = '<EMAIL_SERVER>'
EMAIL_HOST_USER = '<EMAIL>'
EMAIL_HOST_PASSWORD = '<PASSWORD>'
EMAIL_PORT = <EMAIL_PORT>
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '<DB_NAME>',
'USER': '<DB_USER>',
'PASSWORD': '<DB_PASSWORD>',
'HOST': '<DB_HOST>',
'PORT': '<DB_PORT>'
}
}
CACHE_BACKEND = 'locmem:///'
#CACHE_BACKEND = 'db://cache_table?max_entries=5000'
CACHE_MIDDLEWARE_ALIAS = 'andpeople'
CACHE_MIDDLEWARE_SECONDS = 300
# 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.
# 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 = 'es-es'
SITE_ID = 2 # IMPORTANTE: Ajustar para las flatpages
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
USE_L10N = True
DEFAULT_CHARSET = 'utf-8'
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
#MEDIA_ROOT = '/var/www/django/andaluciapeople/media/'
MEDIA_ROOT = path.join(BASEDIR, 'media')
# 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/'
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
ADMIN_MEDIA_PREFIX = '/media/admin/'
# Make this unique, and don't share it with anybody.
SECRET_KEY = '<SECRET_KEY>'
#COMPRESS_ENABLED = not DEBUG
COMPRESS_ENABLED = False
COMPRESS_URL = MEDIA_URL
COMPRESS_ROOT = MEDIA_ROOT
COMPRESS_CSS_FILTERS = ['compressor.filters.cssmin.CSSMinFilter']
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
#'django.template.loaders.app_directories.Loader',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.request',
'andaluciapeople.messages.context_processors.inbox',
'andaluciapeople.sitios.context_processors.ip_address',
'andaluciapeople.sitios.context_processors.pretitle',
)
MIDDLEWARE_CLASSES = (
'django.middleware.gzip.GZipMiddleware',
'localeurl.middleware.LocaleURLMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.middleware.csrf.CsrfResponseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.middleware.doc.XViewMiddleware',
'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
'django.contrib.redirects.middleware.RedirectFallbackMiddleware',
'andaluciapeople.tracking.middleware.VisitorTrackingMiddleware',
'andaluciapeople.tracking.middleware.VisitorCleanUpMiddleware',
'andaluciapeople.tracking.middleware.BannedIPMiddleware',
'andaluciapeople.minidetector.Middleware',
)
ROOT_URLCONF = 'andaluciapeople.urls'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
path.join(BASEDIR, 'templates'),
path.join(BASEDIR, 'blogapp', 'templates'),
path.join(BASEDIR, 'piston', 'templates'),
)
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
)
INSTALLED_APPS = (
'localeurl',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.admin',
'django.contrib.webdesign',
'django.contrib.flatpages',
'django.contrib.redirects',
'django.contrib.sitemaps',
'django.contrib.databrowse',
'django.contrib.humanize',
'django.contrib.markup',
'django.contrib.comments',
'andaluciapeople.sitios',
'andaluciapeople.registration',
'andaluciapeople.sorl.thumbnail',
'andaluciapeople.blogapp',
'andaluciapeople.trackback',
'andaluciapeople.tracking',
'andaluciapeople.messages',
'andaluciapeople.captcha',
'andaluciapeople.api',
'andaluciapeople.oauth_access',
'andaluciapeople.rosetta',
'andaluciapeople.haystack',
'andaluciapeople.hitcount',
'django_extensions',
'south'
)
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
CACHE_DEF_EXPIRE = 60 * 60 * 24
LANGUAGES = (
('es-es', u'Español'),
('en', u'English'),
)
AUTH_PROFILE_MODULE = "sitios.datosusuario"
ACCOUNT_ACTIVATION_DAYS = 2
THUMBNAIL_DEBUG = True
THUMBNAIL_SUBDIR = 'mini'
LOGIN_URL = '/register/'
LOGIN_REDIRECT_URL = '/profile/'
FACEBOOK_API_ID = '<FB_API_ID>'
FACEBOOK_APP_SECRET = '<FB_APP_SECRET>'
OAUTH_CALLBACK_VIEW = 'andaluciapeople.api.views.request_token_ready' # piston
OAUTH_ACCESS_SETTINGS = {
'facebook': {
'keys': {
'KEY': '<FB_KEY>',
'SECRET': '<FB_SECRET>',
},
'endpoints': {
'access_token': 'https://graph.facebook.com/oauth/access_token',
'authorize': 'https://graph.facebook.com/oauth/authorize',
'provider_scope': '',
'callback': 'andaluciapeople.sitios.oauth_callbacks.FacebookCallback',
}
},
'twitter': {
'keys': {
'KEY': '<TW_KEY>',
'SECRET': '<TW_SECRET>',
},
'endpoints': {
'request_token': 'https://api.twitter.com/oauth/request_token',
'access_token': 'https://api.twitter.com/oauth/access_token',
'authorize': 'https://api.twitter.com/oauth/authorize',
'provider_scope': '',
'callback': 'andaluciapeople.sitios.oauth_callbacks.TwitterCallback',
}
},
'google': {
'keys': {
'KEY': '<G_KEY>',
'SECRET': '<G_SECRET>',
},
'endpoints': {
'request_token': 'https://www.google.com/accounts/OAuthGetRequestToken',
'access_token': 'https://www.google.com/accounts/OAuthGetAccessToken',
'authorize': 'https://www.google.com/accounts/OAuthAuthorizeToken',
'provider_scope': '',
'callback': 'andaluciapeople.sitios.oauth_callbacks.GoogleCallback',
}
},
'foursquare': {
'keys': {
'KEY': '<4S_KEY>',
'SECRET': '<4S_SECRET>',
},
'endpoints': {
'request_token': 'http://foursquare.com/oauth/request_token',
'access_token': 'http://foursquare.com/oauth/access_token',
'authorize': 'http://foursquare.com/oauth/authorize',
'provider_scope': '',
'callback': 'andaluciapeople.sitios.oauth_callbacks.FoursquareCallback',
}
}
}
CAPTCHA_FONT_PATH=BASEDIR+"/captcha/fonts/ttf-bitstream-vera-1.10/Vera.ttf"
CAPTCHA_FONT_SIZE=30
CAPTCHA_BACKGROUND_COLOR='#EFEACF'
#CAPTCHA_FILTER_FUNCTIONS=()
LASTFM_API_KEY='<LFM_KEY>'
LASTFM_SECRET_KEY='<LFM_SECRET>'
GOOGLE_MAPS_KEY='<GMAPS_KEY>'
GOOGLE_API_KEY='<GOOGLE_API_KEY>'
LAYAR_DEVELOPER_KEY='<LAYAR_KEY>'
NVIVO_KEY = '<NVIVO_KEY>'
MAINTITLE=u'AndalucíaPeople'
HAYSTACK_SITECONF = 'andaluciapeople.search_sites'
HAYSTACK_INCLUDE_SPELLING = True
HAYSTACK_SEARCH_ENGINE = 'dummy'
HAYSTACK_XAPIAN_PATH = path.join(BASEDIR, 'xapian_index')
HITCOUNT_KEEP_HIT_ACTIVE = { 'days': 7 }
#HITCOUNT_HITS_PER_IP_LIMIT = 0
#HITCOUNT_EXCLUDE_USER_GROUP = ( 'Editor', )
PREFIX_DEFAULT_LOCALE = False
LOCALE_INDEPENDENT_PATHS = (
re.compile('^/localeurl/change/'),
re.compile('^/.*/nvivo/'),
re.compile('^/.*/eventos/list/'),
re.compile('^/.*/sitios\.json/.*'),
)