-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathbase.py
More file actions
224 lines (192 loc) · 5.99 KB
/
base.py
File metadata and controls
224 lines (192 loc) · 5.99 KB
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
# This is your project's main settings file that can be committed to your
# repo. If you need to override a setting locally, use settings_local.py
from funfactory.settings_base import *
TIME_ZONE = 'UTC'
# Bundles is a dictionary of two dictionaries, css and js, which list css files
# and js files that can be bundled together by the minify app.
MINIFY_BUNDLES = {
'css': {
'make_devices': (
'css/ext/normalize.css',
'css/base.less',
),
},
'js': {
'jquery': (
'js/jquery-1.7.2.min.js',
'js/jquery-ui-1.8.20.date.autocomplete.min.js',
),
'core_js': (
'js/core.js',
),
'video-tools': (
'js/mozilla-video-tools.js',
),
'maps_js': (
'js/map.js',
'js/map.infobox.js',
'js/map.clusterer.js',
),
'homgepage_js': (
'js/jquery.tweet.js',
'js/bootstrap-carousel.js',
'js/mozilla-pager.js',
'js/homepage.js',
),
'events_js': (
'js/flickr.js',
'js/folder.js',
),
'example_js': (
'js/examples/libs/jquery-1.4.4.min.js',
'js/examples/libs/jquery.cookie.js',
'js/examples/init.js',
),
}
}
# Defines the views served for root URLs.
ROOT_URLCONF = 'make_mozilla.urls'
SUPPORTED_NONLOCALES += ['robots.txt', ]
INSTALLED_APPS = list(INSTALLED_APPS) + [
'django.contrib.admin',
'django.contrib.gis',
# Application base, containing global templates.
'make_mozilla.base',
# Events and Venues
'make_mozilla.events',
# Tools
'make_mozilla.tools',
# Projects
'make_mozilla.projects',
# News and feed importer
'make_mozilla.news',
# UserProfiles
'make_mozilla.users',
# Pages
'make_mozilla.pages',
# extra lib stuff
'south',
'django_browserid', # Load after auth to monkey-patch it.
'cronjobs',
'waffle',
]
class Setting(object):
def __init__(self, *args, **kwargs):
vars(self).update(kwargs)
@property
def dict(self):
return vars(self)
# Go! Go! Gadget Bleach!
BLEACH = Setting(
allowed_tags=(
'h1', 'h2', 'a', 'b', 'em', 'i', 'strong',
'ol', 'ul', 'li', 'blockquote', 'p',
'span', 'pre', 'code', 'img'
),
allowed_attrs={
'a': ['href', 'title'],
'img': ['src', 'alt', 'title'],
}
)
# Because Jinja2 is the default template loader, add any non-Jinja templated
# apps here:
JINGO_EXCLUDE_APPS = [
'gis',
'admin',
]
# Browser ID
BROWSERID_CREATE_USER = True
BROWSERID_VERIFICATION_URL = 'https://browserid.org/verify'
LOGIN_REDIRECT_URL = '/events/'
LOGIN_URL = '/users/login/'
SITE_URL = 'https://make-dev.mozillalabs.com'
AUTH_PROFILE_MODULE = 'users.Profile'
AUTHENTICATION_BACKENDS = (
'django_browserid.auth.BrowserIDBackend',
'django.contrib.auth.backends.ModelBackend'
)
TEMPLATE_CONTEXT_PROCESSORS = list(TEMPLATE_CONTEXT_PROCESSORS) + [
'django_browserid.context_processors.browserid_form',
'make_mozilla.base.context_processors.login_and_get_back',
'make_mozilla.core.context_processors.app_stage'
]
MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES) + [
'waffle.middleware.WaffleMiddleware',
]
# Tells the extract script what files to look for L10n in and what function
# handles the extraction. The Tower library expects this.
# # Use this if you have localizable HTML files:
# DOMAIN_METHODS['lhtml'] = [
# ('**/templates/**.lhtml',
# 'tower.management.commands.extract.extract_tower_template'),
# ]
# # Use this if you have localizable HTML files:
# DOMAIN_METHODS['javascript'] = [
# # Make sure that this won't pull in strings from external libraries you
# # may use.
# ('media/js/**.js', 'javascript'),
# ]
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
BROWSERID_CREATE_USER = True
# needed to make CSRF function on anonymous forms
ANON_ALWAYS = True
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': ['localhost:11211', ],
'KEY_PREFIX': 'make_mozilla'
}
}
## Log settings
SYSLOG_TAG = "make_mozilla" # Make this unique to your project.
LOGGING = {
'loggers': {
'mk': {
'level': logging.DEBUG,
'handlers': ['syslog', 'console']
},
}
}
BSD_EVENT_JSON_FEED_URLS = (
('hack_jam', 'https://donate.mozilla.org/page/event/search_results?format=json&wrap=no&orderby[0]=date&orderby[1]=desc&event_type=2&mime=application/json&limit=500&country=*'),
('kitchen_table', 'https://donate.mozilla.org/page/event/search_results?format=json&wrap=no&orderby[0]=date&orderby[1]=desc&event_type=1&mime=application/json&limit=500&country=*'),
('pop_up', 'https://donate.mozilla.org/page/event/search_results?format=json&wrap=no&orderby[0]=date&orderby[1]=desc&event_type=3&mime=application/json&limit=500&country=*'),
)
# Common Event Format logging parameters
#CEF_PRODUCT = 'Playdoh'
#CEF_VENDOR = 'Mozilla'
# Potentially sensitive or machine-specific values in the below should be overridden in make_mozilla/settings/local.py
UPLOADED_IMAGES = {
'location': '/var/webapps/make.mozilla.org/shared/partner_media',
'base_url': '/media/partner_media/'
}
BSD_API_DETAILS = {}
DATABASES = {
'default': {
'ENGINE': 'make_mozilla.postgis',
'NAME': 'make_mozilla',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
'OPTIONS': {
},
'TEST_CHARSET': 'utf8',
},
# 'slave': {
# ...
# },
}
SOUTH_DATABASE_ADAPTERS = {
'default': "south.db.postgresql_psycopg2"
}
# Uncomment this and set to all slave DBs in use on the site.
# SLAVE_DATABASES = ['slave']
# CELERY_ALWAYS_EAGER = False # required to activate celeryd
BROKER_URL = "redis://localhost:6379/0"
SITE_URL = 'http://localhost:8000'
# RSS feed for planet news
SITE_FEED_URLS = {
'webmaker': 'http://planet.webmaker.org/rss20.xml',
}