Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 565 lines (482 sloc) 18.236 kB
e3f86da django skeleton
James Socol authored
1 # Django settings for kitsune project.
39ad6fe [bug 595370] Add the server name to the wsgi environment.
James Socol authored
2 import platform
e6f8ac3 Getting basic settings in place
James Socol authored
3 import os
4 import logging
e3f86da django skeleton
James Socol authored
5
6d1cb11 Updating to Tower 0.3 and fixing the failing tests.
James Socol authored
6 from tower import ugettext_lazy as _lazy
2a1a7ab @pcraciunoiu Adding context processor for site title
pcraciunoiu authored
7
c509571 Test that searching in en-US works and make search in en-US work.
James Socol authored
8 from sumo_locales import LOCALES
d03b6f8 Adding middleware and tests. Removing dependency on django-localeurl.…
James Socol authored
9
e3f86da django skeleton
James Socol authored
10 DEBUG = True
11 TEMPLATE_DEBUG = DEBUG
148035f Push celery logs to syslog when DEBUG=False.
James Socol authored
12
13 LOG_LEVEL = logging.INFO
14 SYSLOG_TAG = 'http_sumo_app'
e6f8ac3 Getting basic settings in place
James Socol authored
15
16 ROOT = os.path.dirname(os.path.abspath(__file__))
17 path = lambda *a: os.path.join(ROOT, *a)
e3f86da django skeleton
James Socol authored
18
06167d9 Creating locale submodule, and tweaking some settings so it works.
James Socol authored
19 ROOT_PACKAGE = os.path.basename(ROOT)
20
e3f86da django skeleton
James Socol authored
21 ADMINS = (
22 # ('Your Name', 'your_email@domain.com'),
23 )
24
25 MANAGERS = ADMINS
26
27 DATABASES = {
28 'default': {
8eb19c6 @rlr Implemented questions template (bug 565367)
rlr authored
29 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
30 'NAME': 'kitsune', # Or path to database file if using sqlite3.
31 'USER': '', # Not used with sqlite3.
32 'PASSWORD': '', # Not used with sqlite3.
33 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
34 'PORT': '', # Set to empty string for default. Not used with sqlite3.
6667c90 Fixing errors found by check.py
James Socol authored
35 'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
e3f86da django skeleton
James Socol authored
36 }
37 }
38
203e06c @erikrose Adjust settings to use new pinning database router and middleware.
erikrose authored
39 DATABASE_ROUTERS = ('multidb.PinningMasterSlaveRouter',)
7fff588 Adding multidb support
James Socol authored
40
41 # Put the aliases for your slave databases in this list
42 SLAVE_DATABASES = []
43
09336ac Adding default caching info to settings.py
James Socol authored
44 # Cache Settings
2fbf3ae [bug 570292] remove django-pylibmc from requirements.txt
James Socol authored
45 #CACHE_BACKEND = 'caching.backends.memcached://localhost:11211'
09336ac Adding default caching info to settings.py
James Socol authored
46 #CACHE_PREFIX = 'sumo:'
47
03b9b54 Adding default email addresses to settings.
James Socol authored
48 # Addresses email comes from
49 DEFAULT_FROM_EMAIL = 'notifications@support.mozilla.com'
50 SERVER_EMAIL = 'server-error@support.mozilla.com'
09336ac Adding default caching info to settings.py
James Socol authored
51
39ad6fe [bug 595370] Add the server name to the wsgi environment.
James Socol authored
52 PLATFORM_NAME = platform.node()
53
e3f86da django skeleton
James Socol authored
54 # Local time zone for this installation. Choices can be found here:
55 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
56 # although not all choices may be available on all operating systems.
57 # If running in a Windows environment this must be set to the same as your
58 # system time zone.
aa13ae9 @pcraciunoiu Add Jinja function datetimeformat, use babel and pytz, add tests, add…
pcraciunoiu authored
59 TIME_ZONE = 'US/Pacific'
e3f86da django skeleton
James Socol authored
60
61 # Language code for this installation. All choices can be found here:
62 # http://www.i18nguy.com/unicode/language-identifiers.html
d03b6f8 Adding middleware and tests. Removing dependency on django-localeurl.…
James Socol authored
63 LANGUAGE_CODE = 'en-US'
64
65 # Supported languages
66 SUMO_LANGUAGES = (
1dc6074 @pcraciunoiu Adding locales Akan[ak] (bug 586383) and Armenian[hy-AM] (bug 586318)
pcraciunoiu authored
67 'ak', 'ar', 'as', 'ast', 'bg', 'bn-BD', 'bn-IN', 'bs', 'ca', 'cs', 'da',
68 'de', 'el', 'en-US', 'eo', 'es', 'et', 'eu', 'fa', 'fi', 'fr', 'fur',
69 'fy-NL', 'ga-IE', 'gd', 'gl', 'gu-IN', 'he', 'hi-IN', 'hr', 'hu', 'hy-AM',
1abafd8 @pcraciunoiu [560487] Add Maithili locale.
pcraciunoiu authored
70 'id', 'ilo', 'is', 'it', 'ja', 'kk', 'kn', 'ko', 'lt', 'mai', 'mk', 'mn',
71 'mr', 'ms', 'nb-NO', 'nl', 'no', 'oc', 'pa-IN', 'pl', 'pt-BR', 'pt-PT',
72 'rm', 'ro', 'ru', 'rw', 'si', 'sk', 'sl', 'sq', 'sr-CYRL', 'sr-LATN',
73 'sv-SE', 'ta-LK', 'te', 'th', 'tr', 'uk', 'vi', 'zh-CN', 'zh-TW',
d03b6f8 Adding middleware and tests. Removing dependency on django-localeurl.…
James Socol authored
74 )
75
28061e0 @pcraciunoiu [592670] Media gallery models: a gallery app
pcraciunoiu authored
76 LANGUAGE_CHOICES = tuple([(i, LOCALES[i].native) for i in SUMO_LANGUAGES])
77 LANGUAGES = dict([(i.lower(), LOCALES[i].native) for i in SUMO_LANGUAGES])
d03b6f8 Adding middleware and tests. Removing dependency on django-localeurl.…
James Socol authored
78
79 LANGUAGE_URL_MAP = dict([(i.lower(), i) for i in SUMO_LANGUAGES])
80
06167d9 Creating locale submodule, and tweaking some settings so it works.
James Socol authored
81 TEXT_DOMAIN = 'messages'
e3f86da django skeleton
James Socol authored
82
83 SITE_ID = 1
2a1a7ab @pcraciunoiu Adding context processor for site title
pcraciunoiu authored
84 SITE_TITLE = _lazy(u'Firefox Support', 'site_title')
85
e3f86da django skeleton
James Socol authored
86
87 # If you set this to False, Django will make some optimizations so as not
88 # to load the internationalization machinery.
89 USE_I18N = True
d03b6f8 Adding middleware and tests. Removing dependency on django-localeurl.…
James Socol authored
90 USE_L10N = True
e3f86da django skeleton
James Socol authored
91
92 # Absolute path to the directory that holds media.
93 # Example: "/home/media/media.lawrence.com/"
e6f8ac3 Getting basic settings in place
James Socol authored
94 MEDIA_ROOT = path('media')
e3f86da django skeleton
James Socol authored
95
96 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
97 # trailing slash if there is a path component (optional in other cases).
98 # Examples: "http://media.lawrence.com", "http://example.com/media/"
e6f8ac3 Getting basic settings in place
James Socol authored
99 MEDIA_URL = '/media/'
e3f86da django skeleton
James Socol authored
100
101 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
102 # trailing slash.
103 # Examples: "http://foo.com/media/", "/media/".
e6f8ac3 Getting basic settings in place
James Socol authored
104 ADMIN_MEDIA_PREFIX = '/admin-media/'
e3f86da django skeleton
James Socol authored
105
d03b6f8 Adding middleware and tests. Removing dependency on django-localeurl.…
James Socol authored
106 # Paths that don't require a locale prefix.
ead763b @pcraciunoiu Enable admin and add model forums.Forum to it.
pcraciunoiu authored
107 SUPPORTED_NONLOCALES = ('media', 'admin')
d03b6f8 Adding middleware and tests. Removing dependency on django-localeurl.…
James Socol authored
108
e3f86da django skeleton
James Socol authored
109 # Make this unique, and don't share it with anybody.
110 SECRET_KEY = '#%tc(zja8j01!r#h_y)=hy!^k)9az74k+-ib&ij&+**s3-e^_z'
111
112 # List of callables that know how to import templates from various sources.
113 TEMPLATE_LOADERS = (
114 'django.template.loaders.filesystem.Loader',
115 'django.template.loaders.app_directories.Loader',
116 # 'django.template.loaders.eggs.Loader',
117 )
118
899dcd3 Adding request processor to settings.py
James Socol authored
119 TEMPLATE_CONTEXT_PROCESSORS = (
120 'django.core.context_processors.auth',
121 'django.core.context_processors.debug',
122 'django.core.context_processors.media',
123 'django.core.context_processors.request',
2a1a7ab @pcraciunoiu Adding context processor for site title
pcraciunoiu authored
124 'django.contrib.messages.context_processors.messages',
26e2d76 @pcraciunoiu Adding a login form and REGISTER_URL
pcraciunoiu authored
125
126 'sumo.context_processors.global_settings',
7641075 Update search filters with Help With selection [bug 610424]
James Socol authored
127 'sumo.context_processors.for_data',
b448c41 [bug 591029] Use a different context preprocessor.
James Socol authored
128 'jingo_minify.helpers.build_ids',
129 'csrf_context.csrf',
899dcd3 Adding request processor to settings.py
James Socol authored
130 )
131
e3f86da django skeleton
James Socol authored
132 MIDDLEWARE_CLASSES = (
203e06c @erikrose Adjust settings to use new pinning database router and middleware.
erikrose authored
133 'multidb.middleware.PinningRouterMiddleware',
2ab1e82 @erikrose [573546] Wrap each request in a transaction.
erikrose authored
134
135 # This gives us atomic success or failure on multi-row writes. It does not
136 # give us a consistent per-transaction snapshot for reads; that would need
137 # the serializable isolation level (which InnoDB does support) and code to
138 # retry transactions that roll back due to serialization failures. It's a
139 # possibility for the future. Keep in mind that memcache defeats
140 # snapshotted reads where we don't explicitly use the "uncached" manager.
141 'django.middleware.transaction.TransactionMiddleware',
142
c7da7d9 @erikrose [590776] LocaleURLMiddleware's setting of a thread-local prefixer is …
erikrose authored
143 # LocaleURLMiddleware must be before any middleware that uses
144 # sumo.urlresolvers.reverse() to add locale prefixes to URLs:
d03b6f8 Adding middleware and tests. Removing dependency on django-localeurl.…
James Socol authored
145 'sumo.middleware.LocaleURLMiddleware',
66c2c5c @pcraciunoiu Add 403 middleware and do some nice cleanup of CSS and tests.
pcraciunoiu authored
146 'sumo.middleware.Forbidden403Middleware',
e3f86da django skeleton
James Socol authored
147 'django.middleware.common.CommonMiddleware',
8b91fe6 [bug 584931] Send no-cache headers on HTTPS responses.
James Socol authored
148 'sumo.middleware.NoCacheHttpsMiddleware',
ad69153 @pcraciunoiu Adding TikiUser and Session models, tests, and NoVarySessionMiddleware.
pcraciunoiu authored
149 'commonware.middleware.NoVarySessionMiddleware',
bc49453 Enable X-Frame-Options: DENY headers.
James Socol authored
150 'commonware.middleware.FrameOptionsHeader',
e3f86da django skeleton
James Socol authored
151 'django.middleware.csrf.CsrfViewMiddleware',
152 'django.contrib.auth.middleware.AuthenticationMiddleware',
153 'django.contrib.messages.middleware.MessageMiddleware',
1fc72d3 @rlr Implemented voting for questions / "I have this problem too" (bug 573…
rlr authored
154 'sumo.anonymous.AnonymousIdentityMiddleware',
1ad3f35 Customer Care. Twitter OAuth and template fixes.
Alex Buchanan authored
155 'twitter.middleware.SessionMiddleware',
0b4b2fe Add middleware to replace + with %20 in URLs.
James Socol authored
156 'sumo.middleware.PlusToSpaceMiddleware',
e61699c Add HidePasswordOnException middleware. [bug 601140]
James Socol authored
157 'commonware.middleware.HidePasswordOnException',
ad69153 @pcraciunoiu Adding TikiUser and Session models, tests, and NoVarySessionMiddleware.
pcraciunoiu authored
158 )
159
160 # Auth
161 AUTHENTICATION_BACKENDS = (
7213950 @rlr New users app for login, logout, and redirect (and more to come). [bu…
rlr authored
162 'users.backends.Sha256Backend',
e3f86da django skeleton
James Socol authored
163 )
a523e80 @pcraciunoiu [614049] Profile model! Included: one test and test helper.
pcraciunoiu authored
164 AUTH_PROFILE_MODULE = 'users.Profile'
aa9921d Move avatars up one level.
James Socol authored
165 USER_AVATAR_PATH = 'uploads/avatars/'
daf9101 Update profile_avatar to show the avatar or a default. [bug 616565, b…
James Socol authored
166 DEFAULT_AVATAR = MEDIA_URL + 'img/avatar.png'
8b674ba @pcraciunoiu [478929] Resize avatars and restrict upload size.
pcraciunoiu authored
167 AVATAR_SIZE = 48 # in pixels
a10cdef @rlr Implemented user account activation via confirmation email. [bug 614703]
rlr authored
168 ACCOUNT_ACTIVATION_DAYS = 30
8b674ba @pcraciunoiu [478929] Resize avatars and restrict upload size.
pcraciunoiu authored
169 MAX_AVATAR_FILE_SIZE = 131072 # 100k, in bytes
e3f86da django skeleton
James Socol authored
170
06167d9 Creating locale submodule, and tweaking some settings so it works.
James Socol authored
171 ROOT_URLCONF = '%s.urls' % ROOT_PACKAGE
e3f86da django skeleton
James Socol authored
172
173 TEMPLATE_DIRS = (
bbd7660 use settings for SEARCH_MAX_RESULTS
James Socol authored
174 # Put strings here, like "/home/html/django_templates"
e3f86da django skeleton
James Socol authored
175 # Always use forward slashes, even on Windows.
176 # Don't forget to use absolute paths, not relative paths.
e6f8ac3 Getting basic settings in place
James Socol authored
177 path('templates'),
e3f86da django skeleton
James Socol authored
178 )
179
2babd7c @erikrose [569285] Implement question tagging based on django-taggit, which has…
erikrose authored
180 # TODO: Figure out why changing the order of apps (for example, moving taggit
181 # higher in the list) breaks tests.
e3f86da django skeleton
James Socol authored
182 INSTALLED_APPS = (
183 'django.contrib.auth',
184 'django.contrib.contenttypes',
185 'django.contrib.sessions',
186 'django.contrib.sites',
187 'django.contrib.messages',
ead763b @pcraciunoiu Enable admin and add model forums.Forum to it.
pcraciunoiu authored
188 'django.contrib.admin',
7213950 @rlr New users app for login, logout, and redirect (and more to come). [bu…
rlr authored
189 'users',
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in sett…
James Socol authored
190 'tower',
5a79094 Moving css/js to minify.
James Socol authored
191 'jingo_minify',
06167d9 Creating locale submodule, and tweaking some settings so it works.
James Socol authored
192 ROOT_PACKAGE,
df36d80 @pcraciunoiu Adding authority, with jinja filter and permission checks. Lots of te…
pcraciunoiu authored
193 'authority',
a523e80 @pcraciunoiu [614049] Profile model! Included: one test and test helper.
pcraciunoiu authored
194 'timezones',
fc11704 @pcraciunoiu Creating access app for permissions-related utils, decorators and hel…
pcraciunoiu authored
195 'access',
6eda039 Starting test suite
James Socol authored
196 'sumo',
197 'search',
393b87e Slightly less blank app; blank pages.
James Socol authored
198 'forums',
fca0843 [bug 578067] Upgrade to celery 2
James Socol authored
199 'djcelery',
444855d [bug 575705] Sorting Questions by recent 'me, too' votes
James Socol authored
200 'cronjobs',
a9f19fc Starting the notifications app (bug 563991)
James Socol authored
201 'notifications',
fe112ea Clean up from Dave's comments and add the migration to install the qu…
James Socol authored
202 'questions',
4062066 @rlr Added admin views for settings and environment (bug 572837)
rlr authored
203 'kadmin',
2babd7c @erikrose [569285] Implement question tagging based on django-taggit, which has…
erikrose authored
204 'taggit',
8af5336 @rlr Implemented object flagging app, flagit, for 'Report this post'
rlr authored
205 'flagit',
5495c6e @pcraciunoiu [578520] Add preliminary support for uploading images and basic tests…
pcraciunoiu authored
206 'upload',
0298e71 @erikrose Start wiki app and add skeletal models.
erikrose authored
207 'product_details',
28061e0 @pcraciunoiu [592670] Media gallery models: a gallery app
pcraciunoiu authored
208 'wiki',
4aa9140 Say hello to KB discussion. [bug 602958]
James Socol authored
209 'kbforums',
8f58c81 @pcraciunoiu [586478] New home page
pcraciunoiu authored
210 'dashboards',
28061e0 @pcraciunoiu [592670] Media gallery models: a gallery app
pcraciunoiu authored
211 'gallery',
78f55c9 @fwenzel Customer Care is born. Tweet collection included!
fwenzel authored
212 'customercare',
1ad3f35 Customer Care. Twitter OAuth and template fixes.
Alex Buchanan authored
213 'twitter',
ce54806 Create a new chat app. [bug 605476]
James Socol authored
214 'chat',
1f39be2 adding sphinx configs to settings.py
James Socol authored
215
118c6d3 @pcraciunoiu [bug 616561] Remove unused settings.
pcraciunoiu authored
216 # Extra apps for testing.
217 'django_nose',
218 'test_utils',
219 )
a927cfb Build scripts!
James Socol authored
220
82d584e groundwork for running tests
James Socol authored
221 TEST_RUNNER = 'test_utils.runner.RadicalTestSuiteRunner'
8d435a7 @pcraciunoiu [586176] Deleting image leaves thumbnail behind.
pcraciunoiu authored
222 TEST_UTILS_NO_TRUNCATE = ('django_content_type',)
82d584e groundwork for running tests
James Socol authored
223
8eb19c6 @rlr Implemented questions template (bug 565367)
rlr authored
224
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in sett…
James Socol authored
225 def JINJA_CONFIG():
226 import jinja2
227 from django.conf import settings
228 from caching.base import cache
3b794ae @rlr Implemented Translation review template. [bug 595857]
rlr authored
229 config = {'extensions': ['tower.template.i18n', 'caching.ext.cache',
230 'jinja2.ext.with_'],
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in sett…
James Socol authored
231 'finalize': lambda x: x if x is not None else ''}
232 if 'memcached' in cache.scheme and not settings.DEBUG:
233 # We're passing the _cache object directly to jinja because
234 # Django can't store binary directly; it enforces unicode on it.
235 # Details: http://jinja.pocoo.org/2/documentation/api#bytecode-cache
236 # and in the errors you get when you try it the other way.
237 bc = jinja2.MemcachedBytecodeCache(cache._cache,
238 "%sj2:" % settings.CACHE_PREFIX)
239 config['cache_size'] = -1 # Never clear the cache
240 config['bytecode_cache'] = bc
241 return config
242
716a9a0 [bug 576361] _lazy() strings are now extracted, and forums and questions
James Socol authored
243 # Let Tower know about our additional keywords.
244 # DO NOT import an ngettext variant as _lazy.
245 TOWER_KEYWORDS = {
246 '_lazy': None,
247 }
248
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in sett…
James Socol authored
249 # Tells the extract script what files to look for l10n in and what function
250 # handles the extraction. The Tower library expects this.
251 DOMAIN_METHODS = {
252 'messages': [
5d70383 Ignore the vendor lib for string extration.
James Socol authored
253 ('vendor/**', 'ignore'),
716a9a0 [bug 576361] _lazy() strings are now extracted, and forums and questions
James Socol authored
254 ('apps/forums/**', 'ignore'),
255 ('apps/questions/**', 'ignore'),
ce54806 Create a new chat app. [bug 605476]
James Socol authored
256 ('apps/chat/**', 'ignore'),
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in sett…
James Socol authored
257 ('apps/**.py',
258 'tower.management.commands.extract.extract_tower_python'),
259 ('**/templates/**.html',
260 'tower.management.commands.extract.extract_tower_template'),
261 ],
262 'lhtml': [
716a9a0 [bug 576361] _lazy() strings are now extracted, and forums and questions
James Socol authored
263 ('apps/forums/**', 'ignore'),
264 ('apps/questions/**', 'ignore'),
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in sett…
James Socol authored
265 ('**/templates/**.lhtml',
266 'tower.management.commands.extract.extract_tower_template'),
267 ],
268 'javascript': [
269 # We can't say **.js because that would dive into any libraries.
270 ('media/js/*.js', 'javascript'),
271 ],
272 }
273
eecf219 @stasm [bug 554205] Localizing Javascript
stasm authored
274 # These domains will not be merged into messages.pot and will use separate PO
275 # files. See the following URL for an example of how to set these domains
276 # in DOMAIN_METHODS.
277 # http://github.com/jbalogh/zamboni/blob/d4c64239c24aa2f1e91276909823d1d1b290f0ee/settings.py#L254
278 STANDALONE_DOMAINS = [
279 'javascript',
280 ]
281
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in sett…
James Socol authored
282 # If you have trouble extracting strings with Tower, try setting this
283 # to True
fe7a058 @pcraciunoiu Fix a bunch of pylint violations and make it shut up about some usele…
pcraciunoiu authored
284 TOWER_ADD_HEADERS = True
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in sett…
James Socol authored
285
5a79094 Moving css/js to minify.
James Socol authored
286 # Bundles for JS/CSS Minification
287 MINIFY_BUNDLES = {
288 'css': {
289 'common': (
86645ba @pcraciunoiu [615354] Use mozilla/django-moz-header:
pcraciunoiu authored
290 'css/reset.css',
291 'global/headerfooter.css',
5a79094 Moving css/js to minify.
James Socol authored
292 'css/main.css',
293 'css/sidebar.css',
a4bd557 @rlr created forums css bundle and a forums/base.html to include it (bug 5…
rlr authored
294 ),
295 'forums': (
eb2d19c @pcraciunoiu Remove paginator.css, move datetimeformat helper to sumo app, use lis…
pcraciunoiu authored
296 'css/forums.css',
5a79094 Moving css/js to minify.
James Socol authored
297 ),
8eb19c6 @rlr Implemented questions template (bug 565367)
rlr authored
298 'questions': (
da17b15 @pcraciunoiu [604211] Delete and edit images and videos. Includes permissions.
pcraciunoiu authored
299 'css/to-delete.css',
8eb19c6 @rlr Implemented questions template (bug 565367)
rlr authored
300 'css/questions.css',
2babd7c @erikrose [569285] Implement question tagging based on django-taggit, which has…
erikrose authored
301 'css/tags.css',
302 'css/jqueryui/jquery.ui.core.css',
303 'css/jqueryui/jquery.ui.autocomplete.css',
304 'css/jqueryui/jquery.ui.theme.css',
8eb19c6 @rlr Implemented questions template (bug 565367)
rlr authored
305 ),
5a79094 Moving css/js to minify.
James Socol authored
306 'search': (
307 'css/search.css',
308 ),
9eb84ce @rlr Some boilerplate for wiki app.
rlr authored
309 'wiki': (
310 'css/wiki.css',
1d71650 @erikrose [603808] Built out infrastructure for the Localization (and Contribut…
erikrose authored
311 # The dashboard app uses the wiki bundle because only the wiki app
312 # has the new theme at the moment.
313 'css/dashboards.css',
e664ef5 @pcraciunoiu [600747] Video hook and render with Flash fallback.
pcraciunoiu authored
314 'css/screencast.css',
cc40a9a @erikrose [575820] [602325] Implement nice tagging widget for KB document editi…
erikrose authored
315 'css/tags.css',
316 'css/jqueryui/jquery.ui.core.css',
317 'css/jqueryui/jquery.ui.autocomplete.css',
318 'css/jqueryui/jquery.ui.theme.css',
9eb84ce @rlr Some boilerplate for wiki app.
rlr authored
319 ),
8f58c81 @pcraciunoiu [586478] New home page
pcraciunoiu authored
320 'home': (
321 'css/home.css',
322 ),
0d7b903 @rlr [bug 592671] Media and media gallery page
rlr authored
323 'gallery': (
da17b15 @pcraciunoiu [604211] Delete and edit images and videos. Includes permissions.
pcraciunoiu authored
324 'css/to-delete.css',
0d7b903 @rlr [bug 592671] Media and media gallery page
rlr authored
325 'css/gallery.css',
326 ),
35c5fb7 @pcraciunoiu Add breadcrumbs and use them throughout the site. Also fix test.
pcraciunoiu authored
327 'ie': (
328 'css/ie.css',
329 ),
f919dbd Customer Care templates
Alex Buchanan authored
330 'customercare': (
331 'css/jqueryui/jquery.ui.core.css',
332 'css/jqueryui/jquery.ui.theme.css',
333 'css/customercare.css',
334 ),
ce54806 Create a new chat app. [bug 605476]
James Socol authored
335 'chat': (
336 'css/chat.css',
337 ),
7213950 @rlr New users app for login, logout, and redirect (and more to come). [bu…
rlr authored
338 'users': (
339 'css/users.css',
340 ),
5a79094 Moving css/js to minify.
James Socol authored
341 },
342 'js': {
343 'common': (
8eb19c6 @rlr Implemented questions template (bug 565367)
rlr authored
344 'js/libs/jquery.min.js',
854f009 @pcraciunoiu [615818] Upgrade modernizr to 1.6
pcraciunoiu authored
345 'js/libs/modernizr-1.6.min.js',
86645ba @pcraciunoiu [615354] Use mozilla/django-moz-header:
pcraciunoiu authored
346 'global/menu.js',
c8e175c @pcraciunoiu New thread and new reply validation: display errors. Includes tests a…
pcraciunoiu authored
347 'js/main.js',
5a79094 Moving css/js to minify.
James Socol authored
348 ),
8eb19c6 @rlr Implemented questions template (bug 565367)
rlr authored
349 'questions': (
2babd7c @erikrose [569285] Implement question tagging based on django-taggit, which has…
erikrose authored
350 'js/libs/jqueryui.min.js',
5495c6e @pcraciunoiu [578520] Add preliminary support for uploading images and basic tests…
pcraciunoiu authored
351 'js/markup.js',
e69dbc7 @pcraciunoiu [595376] Upload frontend for images and videos in the gallery
pcraciunoiu authored
352 'js/libs/jquery.ajaxupload.js',
6bb15f7 @pcraciunoiu [614011] AAQ login/register, now its own page.
pcraciunoiu authored
353 'js/libs/jquery.modal.js',
5495c6e @pcraciunoiu [578520] Add preliminary support for uploading images and basic tests…
pcraciunoiu authored
354 'js/upload.js',
355 'js/questions.js',
2babd7c @erikrose [569285] Implement question tagging based on django-taggit, which has…
erikrose authored
356 'js/tags.js',
8eb19c6 @rlr Implemented questions template (bug 565367)
rlr authored
357 ),
5a79094 Moving css/js to minify.
James Socol authored
358 'search': (
8eb19c6 @rlr Implemented questions template (bug 565367)
rlr authored
359 'js/libs/jqueryui.min.js',
5a79094 Moving css/js to minify.
James Socol authored
360 'js/search.js',
361 ),
d2a3a06 Add quick markup buttons to editor (bug 563986)
Joshua Gross authored
362 'forums': (
363 'js/markup.js',
adfc4b7 @rlr * Refactored Marky for easier customization between the different apps
rlr authored
364 'js/forums.js',
9eb84ce @rlr Some boilerplate for wiki app.
rlr authored
365 ),
e69dbc7 @pcraciunoiu [595376] Upload frontend for images and videos in the gallery
pcraciunoiu authored
366 'gallery': (
367 'js/libs/jquery.ajaxupload.js',
368 'js/gallery.js',
369 ),
9eb84ce @rlr Some boilerplate for wiki app.
rlr authored
370 'wiki': (
adfc4b7 @rlr * Refactored Marky for easier customization between the different apps
rlr authored
371 'js/markup.js',
2899747 @pcraciunoiu [592100] Adding slug for documents and use it for internal links
pcraciunoiu authored
372 'js/libs/django/urlify.js',
373 'js/libs/django/prepopulate.js',
905cbe4 @erikrose [597254] Implement sticky OS and browser selection on KB documents.
erikrose authored
374 'js/libs/jquery.cookie.js',
da74a18 @erikrose [597252] Build browser/version and OS sniffing for document pages.
erikrose authored
375 'js/browserdetect.js',
e664ef5 @pcraciunoiu [600747] Video hook and render with Flash fallback.
pcraciunoiu authored
376 'js/libs/swfobject.js',
3519247 @rlr Styled the "Help with:" selects. Uses jquery.selectbox plugin. [bug 6…
rlr authored
377 'js/libs/jquery.selectbox-1.2.js',
3a77be4 @pcraciunoiu [609027] Video modal
pcraciunoiu authored
378 'js/libs/jquery.modal.js',
89a38e2 @pcraciunoiu Also fix broken JS on home page after minification.
pcraciunoiu authored
379 'js/screencast.js',
905cbe4 @erikrose [597254] Implement sticky OS and browser selection on KB documents.
erikrose authored
380 'js/wiki.js',
cc40a9a @erikrose [575820] [602325] Implement nice tagging widget for KB document editi…
erikrose authored
381 'js/libs/jqueryui.min.js',
382 'js/tags.js',
9eb84ce @rlr Some boilerplate for wiki app.
rlr authored
383 ),
f919dbd Customer Care templates
Alex Buchanan authored
384 'customercare': (
385 'js/libs/jqueryui.min.js',
386 'js/libs/jquery.NobleCount.js',
591d886 Customer Care, when prompting for auth, remember which tweet a user i…
Alex Buchanan authored
387 'js/libs/jquery.cookie.js',
ce9fafc @fwenzel Infinite scrolling for Customer Care page. Bug 606342.
fwenzel authored
388 'js/libs/jquery.bullseye-1.0.min.js',
f919dbd Customer Care templates
Alex Buchanan authored
389 'js/customercare.js',
390 ),
ce54806 Create a new chat app. [bug 605476]
James Socol authored
391 'chat': (
392 'js/chat.js',
393 ),
5f41630 @pcraciunoiu [bug 617096] Better public emails.
pcraciunoiu authored
394 'users': (
395 'js/users.js',
396 ),
5a79094 Moving css/js to minify.
James Socol authored
397 },
398 }
399
400 JAVA_BIN = '/usr/bin/java'
401
402 #
7b452cb Change Kitsune session behavior (bug 567297)
Joshua Gross authored
403 # Session cookies
404 SESSION_COOKIE_SECURE = True
405 SESSION_EXPIRE_AT_BROWSER_CLOSE = True
406
407 #
1f39be2 adding sphinx configs to settings.py
James Socol authored
408 # Connection information for Sphinx search
409 SPHINX_HOST = '127.0.0.1'
9231955 Changing the sphinx port to not overlap with AMO's default for testing.
James Socol authored
410 SPHINX_PORT = 3381
559c348 More handy updates to Sphinx tests, thanks to Dave.
James Socol authored
411 SPHINXQL_PORT = 3382
603141f new adding settings for search forum thread weight decay
James Socol authored
412
a927cfb Build scripts!
James Socol authored
413 SPHINX_INDEXER = '/usr/bin/indexer'
414 SPHINX_SEARCHD = '/usr/bin/searchd'
8e39688 Adding in the machinery to do sphinx tests
James Socol authored
415 SPHINX_CONFIG_PATH = path('configs/sphinx/sphinx.conf')
416
559c348 More handy updates to Sphinx tests, thanks to Dave.
James Socol authored
417 TEST_SPHINX_PATH = path('tmp/test/sphinx')
418 TEST_SPHINX_PORT = 3416
419 TEST_SPHINXQL_PORT = 3418
420
bbd7660 use settings for SEARCH_MAX_RESULTS
James Socol authored
421 SEARCH_MAX_RESULTS = 1000
d72455a Rename a few settings from SPHINX_* to SEARCH_*
James Socol authored
422 SEARCH_RESULTS_PER_PAGE = 10
423
424 # Search default settings
2b7a896 @erikrose [579205] Implement search-based article suggestions when asking a new…
erikrose authored
425 # comma-separated tuple of included category IDs. Negative IDs are excluded.
44cb5fe @pcraciunoiu Update categories: Navigation, How to, and renumbering.
pcraciunoiu authored
426 SEARCH_DEFAULT_CATEGORIES = (10, 20,)
33fbc03 @pcraciunoiu move __init__ to common SearchClient and define constant for multiplier
pcraciunoiu authored
427 SEARCH_SUMMARY_LENGTH = 275
08c5ea1 Set 15-minute expires headers on search result pages (bug 564379)
Joshua Gross authored
428
429 # The length for which we would like the user to cache search forms and
430 # results, in minutes.
431 SEARCH_CACHE_PERIOD = 15
df36d80 @pcraciunoiu Adding authority, with jinja filter and permission checks. Lots of te…
pcraciunoiu authored
432
6c20d6c @pcraciunoiu [596116] Unicode in filenames now supported in upload app. And more.
pcraciunoiu authored
433 # Maximum length of the filename. Forms should use this and raise
434 # ValidationError if the length is exceeded.
435 # @see http://code.djangoproject.com/ticket/9893
436 # Columns are 250 but this leaves 50 chars for the upload_to prefix
437 MAX_FILENAME_LENGTH = 200
438 MAX_FILEPATH_LENGTH = 250
cdd1871 @pcraciunoiu [bug 596116] Rename uploaded files to something in ascii.
pcraciunoiu authored
439 # Default storage engine - ours does not preserve filenames
440 DEFAULT_FILE_STORAGE = 'upload.storage.RenameFileStorage'
6c20d6c @pcraciunoiu [596116] Unicode in filenames now supported in upload app. And more.
pcraciunoiu authored
441
df36d80 @pcraciunoiu Adding authority, with jinja filter and permission checks. Lots of te…
pcraciunoiu authored
442 # Auth and permissions related constants
7213950 @rlr New users app for login, logout, and redirect (and more to come). [bu…
rlr authored
443 LOGIN_URL = '/users/login'
444 LOGOUT_URL = '/users/logout'
445 LOGIN_REDIRECT_URL = "/"
446 LOGOUT_REDIRECT_URL = "/"
447 REGISTER_URL = '/users/register'
118c6d3 @pcraciunoiu [bug 616561] Remove unused settings.
pcraciunoiu authored
448
449 # Video settings, hard coded here for now.
450 # TODO: figure out a way that doesn't need these values
e664ef5 @pcraciunoiu [600747] Video hook and render with Flash fallback.
pcraciunoiu authored
451 WIKI_VIDEO_WIDTH = 640
452 WIKI_VIDEO_HEIGHT = 480
a9f19fc Starting the notifications app (bug 563991)
James Socol authored
453
58b33d7 @pcraciunoiu [582847] Add upload limit (1MB) and enforce it. Also fix up some JS q…
pcraciunoiu authored
454 IMAGE_MAX_FILESIZE = 1048576 # 1 megabyte, in bytes
8d9a069 @pcraciunoiu [578520] Delete images and upload with no JS, thumbnail generation an…
pcraciunoiu authored
455 THUMBNAIL_SIZE = 120 # Thumbnail size, in pixels
456 THUMBNAIL_UPLOAD_PATH = 'uploads/images/thumbnails/'
457 IMAGE_UPLOAD_PATH = 'uploads/images/'
458 # A string listing image mime types to accept, comma separated.
459 # String must not contain double quotes!
460 IMAGE_ALLOWED_MIMETYPES = 'image/jpeg,image/png,image/gif'
5495c6e @pcraciunoiu [578520] Add preliminary support for uploading images and basic tests…
pcraciunoiu authored
461
2b7a896 @erikrose [579205] Implement search-based article suggestions when asking a new…
erikrose authored
462 # Max number of wiki pages or other questions to suggest might answer the
463 # question you're about to ask
464 QUESTIONS_MAX_SUGGESTIONS = 5
465 # Number of extra suggestion results to pull from Sphinx to make up for
466 # possibly deleted wiki pages or question. To be safe, set this to the number
467 # of things that could be deleted between indexer runs.
468 QUESTIONS_SUGGESTION_SLOP = 3
469
a9f19fc Starting the notifications app (bug 563991)
James Socol authored
470 # Email
471 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
472
3a929b1 Server-side read-only implementation, thanks Jeff! [bug 570284]
James Socol authored
473
474 # Read-only mode setup.
475 READ_ONLY = False
476
118c6d3 @pcraciunoiu [bug 616561] Remove unused settings.
pcraciunoiu authored
477
3a929b1 Server-side read-only implementation, thanks Jeff! [bug 570284]
James Socol authored
478 # Turn on read-only mode in settings_local.py by putting this line
479 # at the VERY BOTTOM: read_only_mode(globals())
480 def read_only_mode(env):
481 env['READ_ONLY'] = True
482
483 # Replace the default (master) db with a slave connection.
484 if not env.get('SLAVE_DATABASES'):
485 raise Exception("We need at least one slave database.")
486 slave = env['SLAVE_DATABASES'][0]
487 env['DATABASES']['default'] = env['DATABASES'][slave]
488
489 # No sessions without the database, so disable auth.
490 env['AUTHENTICATION_BACKENDS'] = ()
491
492 # Add in the read-only middleware before csrf middleware.
493 extra = 'sumo.middleware.ReadOnlyMiddleware'
494 before = 'django.middleware.csrf.CsrfViewMiddleware'
495 m = list(env['MIDDLEWARE_CLASSES'])
496 m.insert(m.index(before), extra)
497 env['MIDDLEWARE_CLASSES'] = tuple(m)
498
499
a9f19fc Starting the notifications app (bug 563991)
James Socol authored
500 # Celery
fca0843 [bug 578067] Upgrade to celery 2
James Socol authored
501 import djcelery
502 djcelery.setup_loader()
503
a9f19fc Starting the notifications app (bug 563991)
James Socol authored
504 BROKER_HOST = 'localhost'
505 BROKER_PORT = 5672
506 BROKER_USER = 'kitsune'
507 BROKER_PASSWORD = 'kitsune'
508 BROKER_VHOST = 'kitsune'
509 CELERY_RESULT_BACKEND = 'amqp'
510 CELERY_IGNORE_RESULT = True
79acb5f Notifications app tests
James Socol authored
511 CELERY_ALWAYS_EAGER = True # For tests. Set to False for use.
77760ab Push Celery logs to syslog, for real this time.
James Socol authored
512 CELERY_SEND_TASK_ERROR_EMAILS = True
513 CELERYD_LOG_LEVEL = logging.INFO
514 CELERYD_CONCURRENCY = 4
1fc72d3 @rlr Implemented voting for questions / "I have this problem too" (bug 573…
rlr authored
515
7c24fb4 A KB-rebuild task. [bug 589853]
James Socol authored
516 # Wiki rebuild settings
517 WIKI_REBUILD_TOKEN = 'sumo:wiki:full-rebuild'
518 WIKI_REBUILD_ON_DEMAND = False
519
1fc72d3 @rlr Implemented voting for questions / "I have this problem too" (bug 573…
rlr authored
520 # Anonymous user cookie
521 ANONYMOUS_COOKIE_NAME = 'SUMO_ANONID'
522 ANONYMOUS_COOKIE_MAX_AGE = 30 * 86400 # Seconds
d17cdd7 @rlr Implemented top contributors list (bug 573075)
rlr authored
523
524 # Top contributors cache settings
525 TOP_CONTRIBUTORS_CACHE_KEY = 'sumo:TopContributors'
526 TOP_CONTRIBUTORS_CACHE_TIMEOUT = 60 * 60 * 12
0298e71 @erikrose Start wiki app and add skeletal models.
erikrose authored
527
45c4b99 @erikrose Make firefox_versions and operating_systems delegate to the parent do…
erikrose authored
528 # Do not change this without also deleting all wiki documents:
0298e71 @erikrose Start wiki app and add skeletal models.
erikrose authored
529 WIKI_DEFAULT_LANGUAGE = LANGUAGE_CODE
28061e0 @pcraciunoiu [592670] Media gallery models: a gallery app
pcraciunoiu authored
530
531 # Gallery settings
532 GALLERY_DEFAULT_LANGUAGE = WIKI_DEFAULT_LANGUAGE
533 GALLERY_IMAGE_PATH = 'uploads/gallery/images/'
534 GALLERY_IMAGE_THUMBNAIL_PATH = 'uploads/gallery/images/thumbnails/'
535 GALLERY_VIDEO_PATH = 'uploads/gallery/videos/'
b51d8b5 @pcraciunoiu [613329] Videos can link to CDN if setting provided.
pcraciunoiu authored
536 GALLERY_VIDEO_URL = None
28061e0 @pcraciunoiu [592670] Media gallery models: a gallery app
pcraciunoiu authored
537 GALLERY_VIDEO_THUMBNAIL_PATH = 'uploads/gallery/videos/thumbnails/'
9d356ed @pcraciunoiu Add chowse's video thumbnail placeholder and use it.
pcraciunoiu authored
538 GALLERY_VIDEO_THUMBNAIL_PROGRESS_URL = MEDIA_URL + 'img/video-thumb.png'
e69dbc7 @pcraciunoiu [595376] Upload frontend for images and videos in the gallery
pcraciunoiu authored
539 THUMBNAIL_PROGRESS_WIDTH = 32 # width of the above image
540 THUMBNAIL_PROGRESS_HEIGHT = 32 # height of the above image
57f3f56 @pcraciunoiu [592674] Media gallery uploads backend
pcraciunoiu authored
541 VIDEO_MAX_FILESIZE = 16777216 # 16 megabytes, in bytes
78f55c9 @fwenzel Customer Care is born. Tweet collection included!
fwenzel authored
542
a6f1910 @fwenzel Show tweet statistics in the Customer Care sidebar. Bugs 612952, 6129…
fwenzel authored
543 # Customer Care settings
544 CC_MAX_TWEETS = 500 # Max. no. of tweets in DB
545 CC_TWEETS_PERPAGE = 100 # How many tweets to collect in one go. Max: 100.
546 CC_SHOW_REPLIES = True # Show replies to tweets?
f919dbd Customer Care templates
Alex Buchanan authored
547
a6f1910 @fwenzel Show tweet statistics in the Customer Care sidebar. Bugs 612952, 6129…
fwenzel authored
548 CC_TWEET_ACTIVITY_URL = 'https://metrics.mozilla.com/stats/twitter/armyOfAwesomeKillRate.json' # Tweet activity stats
549 CC_TOP_CONTRIB_URL = 'https://metrics.mozilla.com/stats/twitter/armyOfAwesomeTopSoldiers.json' # Top contributor stats
550 CC_TWEET_ACTIVITY_CACHE_KEY = 'sumo-cc-tweet-stats'
551 CC_TOP_CONTRIB_CACHE_KEY = 'sumo-cc-top-contrib-stats'
552 CC_STATS_CACHE_TIMEOUT = 24 * 60 * 60 # 24 hours
f8b4bf3 @fwenzel Warn if Customercare stats data is outdated. Bug 612966.
fwenzel authored
553 CC_STATS_WARNING = 30 * 60 * 60 # Warn if JSON data is older than 30 hours
118c6d3 @pcraciunoiu [bug 616561] Remove unused settings.
pcraciunoiu authored
554 CC_IGNORE_USERS = ['fx4status'] # User names whose tweets to ignore.
1013db8 @fwenzel CC_SHOW_REPLIES setting to switch off showing tweet replies if necess…
fwenzel authored
555
f919dbd Customer Care templates
Alex Buchanan authored
556 TWITTER_CONSUMER_KEY = ''
557 TWITTER_CONSUMER_SECRET = ''
8a85a71 @rlr Added `ready for review` notification [bug 599022]
rlr authored
558
a6f1910 @fwenzel Show tweet statistics in the Customer Care sidebar. Bugs 612952, 6129…
fwenzel authored
559
8a85a71 @rlr Added `ready for review` notification [bug 599022]
rlr authored
560 NOTIFICATIONS_FROM_ADDRESS = 'notifications@support.mozilla.com'
ce54806 Create a new chat app. [bug 605476]
James Socol authored
561
562 # URL of the chat server.
563 CHAT_SERVER = 'https://chat-support.mozilla.com:9091'
564 CHAT_CACHE_KEY = 'sumo-chat-queue-status'
Something went wrong with that request. Please try again.