-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.py
executable file
·256 lines (200 loc) · 7 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
# Django settings for the locast travels project.
# All variables indicated as "settings_local" should be overriden
# within a deployment specific settings_local.py file
# settings_local
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# Whether or not this is a production machine
# (Used for google analytics type things)
PRODUCTION = False
# settings_local
ADMINS = None
MANAGERS = None
# Set this in settings_local.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': '', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
# Placeholder for a caching backend
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
# 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.
# This should always be UTC. All timezone conversion should happen on the client side.
TIME_ZONE = 'UTC'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
# settings_local
LANGUAGE_CODE = None
LANGUAGES = None
# settings_local
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
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = False
# The host address of this installation, i.e. http://locast.mit.edu
# settings_local
HOST = ''
# The absolute URL of the application, i.e. /civicmedia
# settings_local
BASE_URL = None
# Generally, FULL_BASE_URL = HOST + BASE_URL
# settings_local
FULL_BASE_URL = ''
# settings_local
LOGIN_REDIRECT_URL = ''
LOGIN_URL = ''
# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
# settings_local
MEDIA_ROOT = ''
# 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/"
# settings_local
MEDIA_URL = ''
# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
# trailing slash.
# Examples: "http://foo.com/media/", "/media/".
# settings_local
ADMIN_MEDIA_PREFIX = ''
# Make this unique, and don't share it with anybody.
SECRET_KEY = ''
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend',
'locast.auth.backends.LocastEmailBackend',
'locast.auth.backends.LocastUsernameBackend',
'social.backends.twitter.TwitterOAuth',
'social.backends.facebook.FacebookOAuth2',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.core.context_processors.csrf',
'django.contrib.messages.context_processors.messages',
'locast.context_processors.settings_variables',
'social.apps.django_app.context_processors.backends',
'social.apps.django_app.context_processors.login_redirect',
'travels.settings_context_processor.project_settings',
'travels.settings_context_processor.settings_variables',
)
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
('rtl.loaders.Loader', (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
)),
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
#'debug_toolbar.middleware.DebugToolbarMiddleware',
'locast.middleware.LocastMiddleware',
'social.apps.django_app.middleware.SocialAuthExceptionMiddleware',
)
INTERNAL_IPS = ('127.0.0.1',)
ROOT_URLCONF = 'urls'
import os
BASE_PATH = os.path.split(__file__)[0]
TEMPLATE_DIRS = (
# These are loaded by the template app loader
)
LOCALE_PATHS = (
'%s/locale/' % BASE_PATH,
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.gis',
'django.contrib.staticfiles',
'locast',
'south',
'sorl.thumbnail',
'modeltranslation',
'social.apps.django_app.default',
'travels',
#'debug_toolbar',
)
MODELTRANSLATION_TRANSLATION_REGISTRY = 'travels.translation'
### LOCAST SETTINGS ###
LOCAST_CORE_VERSION = 'dev'
APP_LABEL = 'travels'
USER_MODEL = 'travels.TravelsUser'
USER_ACTIONS = (
'joined',
'created',
'commented',
)
SOCIAL_AUTH_USER_MODEL = USER_MODEL
SOCIAL_AUTH_LOGIN_URL = '/my_account/'
SOCIAL_AUTH_LOGIN_ERROR_URL = '/my_account/'
SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/my_account/'
SOCIAL_AUTH_DISCONNECT_REDIRECT_URL = '/my_account/'
SOCIAL_AUTH_FACEBOOK_SCOPE = ['publish_actions', 'email']
SOCIAL_AUTH_FACEBOOK_EXTRA_DATA = [('username', 'username'), ('name', 'name')]
SOCIAL_AUTH_TWITTER_EXTRA_DATA = [('screen_name', 'screen_name')]
SOCIAL_AUTH_PIPELINE = (
'social.pipeline.social_auth.social_details',
'social.pipeline.social_auth.social_uid',
'social.pipeline.social_auth.auth_allowed',
'social.pipeline.social_auth.social_user',
'social.pipeline.social_auth.associate_user',
'social.pipeline.social_auth.load_extra_data',
)
# OAuth keys, fill them on settings_local
SOCIAL_AUTH_FACEBOOK_KEY = ''
SOCIAL_AUTH_FACEBOOK_SECRET = ''
SOCIAL_AUTH_TWITTER_KEY = ''
SOCIAL_AUTH_TWITTER_SECRET = ''
DEFAULT_PRIVACY = 3
# settings_local
DEFAULT_LON = 0.0
DEFAULT_LAT = 0.0
DEFAULT_ZOOM = 0
ZOOM_OFFSET = 8
GOOGLE_MAPS_KEY = ''
VOY_BRANDING = False
# Allows arbitrary settings variables to be exposed to templates
CONTEXT_VARIABLES = (
'GOOGLE_MAPS_KEY',
'GOOGLE_ANALYTICS_ID',
'FLOWPLAYER_SWF',
'DEFAULT_LON',
'DEFAULT_LAT',
'DEFAULT_ZOOM',
'ZOOM_OFFSET',
'PRODUCTION',
'VOY_BRANDING',
)
# import settings_local
try: from settings_local import *
except ImportError: raise 'Cannot find settings_local.py!'