Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 574 lines (493 sloc) 18.563 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 Paul Craciunoiu 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. Ad...
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 ricky rosario 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 Erik Rose 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 Paul Craciunoiu Add Jinja function datetimeformat, use babel and pytz, add tests, add 'N...
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. Ad...
James Socol authored
63 LANGUAGE_CODE = 'en-US'
64
65 # Supported languages
66 SUMO_LANGUAGES = (
1dc6074 Paul Craciunoiu 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 Paul Craciunoiu [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. Ad...
James Socol authored
74 )
75
28061e0 Paul Craciunoiu [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. Ad...
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 Paul Craciunoiu 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. Ad...
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. Ad...
James Socol authored
106 # Paths that don't require a locale prefix.
ead763b Paul Craciunoiu 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. Ad...
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 Paul Craciunoiu Adding context processor for site title
pcraciunoiu authored
124 'django.contrib.messages.context_processors.messages',
26e2d76 Paul Craciunoiu 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 Erik Rose Adjust settings to use new pinning database router and middleware.
erikrose authored
133 'multidb.middleware.PinningRouterMiddleware',
2ab1e82 Erik Rose [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 Erik Rose [590776] LocaleURLMiddleware's setting of a thread-local prefixer is now...
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. Ad...
James Socol authored
145 'sumo.middleware.LocaleURLMiddleware',
66c2c5c Paul Craciunoiu 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 Paul Craciunoiu 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 ricky rosario Implemented voting for questions / "I have this problem too" (bug 573072...
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 Paul Craciunoiu Adding TikiUser and Session models, tests, and NoVarySessionMiddleware.
pcraciunoiu authored
158 )
159
160 # Auth
161 AUTHENTICATION_BACKENDS = (
7213950 ricky rosario New users app for login, logout, and redirect (and more to come). [bug 6...
rlr authored
162 'users.backends.Sha256Backend',
e3f86da django skeleton
James Socol authored
163 )
a523e80 Paul Craciunoiu [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, bug ...
James Socol authored
166 DEFAULT_AVATAR = MEDIA_URL + 'img/avatar.png'
8b674ba Paul Craciunoiu [478929] Resize avatars and restrict upload size.
pcraciunoiu authored
167 AVATAR_SIZE = 48 # in pixels
a10cdef ricky rosario Implemented user account activation via confirmation email. [bug 614703]
rlr authored
168 ACCOUNT_ACTIVATION_DAYS = 30
8b674ba Paul Craciunoiu [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 Erik Rose [569285] Implement question tagging based on django-taggit, which has a ...
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 Paul Craciunoiu Enable admin and add model forums.Forum to it.
pcraciunoiu authored
188 'django.contrib.admin',
7213950 ricky rosario New users app for login, logout, and redirect (and more to come). [bug 6...
rlr authored
189 'users',
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in setting...
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 Paul Craciunoiu Adding authority, with jinja filter and permission checks. Lots of tests...
pcraciunoiu authored
193 'authority',
a523e80 Paul Craciunoiu [614049] Profile model! Included: one test and test helper.
pcraciunoiu authored
194 'timezones',
fc11704 Paul Craciunoiu Creating access app for permissions-related utils, decorators and helper...
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 quest...
James Socol authored
202 'questions',
4062066 ricky rosario Added admin views for settings and environment (bug 572837)
rlr authored
203 'kadmin',
2babd7c Erik Rose [569285] Implement question tagging based on django-taggit, which has a ...
erikrose authored
204 'taggit',
8af5336 ricky rosario Implemented object flagging app, flagit, for 'Report this post'
rlr authored
205 'flagit',
5495c6e Paul Craciunoiu [578520] Add preliminary support for uploading images and basic tests. U...
pcraciunoiu authored
206 'upload',
0298e71 Erik Rose Start wiki app and add skeletal models.
erikrose authored
207 'product_details',
28061e0 Paul Craciunoiu [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 Paul Craciunoiu [586478] New home page
pcraciunoiu authored
210 'dashboards',
28061e0 Paul Craciunoiu [592670] Media gallery models: a gallery app
pcraciunoiu authored
211 'gallery',
78f55c9 Fred Wenzel 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',
e3f86da django skeleton
James Socol authored
215 )
1f39be2 adding sphinx configs to settings.py
James Socol authored
216
a927cfb Build scripts!
James Socol authored
217 # Extra apps for testing
218 if DEBUG:
219 INSTALLED_APPS += (
220 'django_extensions',
221 'django_nose',
222 'test_utils',
ad69153 Paul Craciunoiu Adding TikiUser and Session models, tests, and NoVarySessionMiddleware.
pcraciunoiu authored
223 )
a927cfb Build scripts!
James Socol authored
224
82d584e groundwork for running tests
James Socol authored
225 TEST_RUNNER = 'test_utils.runner.RadicalTestSuiteRunner'
8d435a7 Paul Craciunoiu [586176] Deleting image leaves thumbnail behind.
pcraciunoiu authored
226 TEST_UTILS_NO_TRUNCATE = ('django_content_type',)
82d584e groundwork for running tests
James Socol authored
227
8eb19c6 ricky rosario Implemented questions template (bug 565367)
rlr authored
228
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in setting...
James Socol authored
229 def JINJA_CONFIG():
230 import jinja2
231 from django.conf import settings
232 from caching.base import cache
3b794ae ricky rosario Implemented Translation review template. [bug 595857]
rlr authored
233 config = {'extensions': ['tower.template.i18n', 'caching.ext.cache',
234 'jinja2.ext.with_'],
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in setting...
James Socol authored
235 'finalize': lambda x: x if x is not None else ''}
236 if 'memcached' in cache.scheme and not settings.DEBUG:
237 # We're passing the _cache object directly to jinja because
238 # Django can't store binary directly; it enforces unicode on it.
239 # Details: http://jinja.pocoo.org/2/documentation/api#bytecode-cache
240 # and in the errors you get when you try it the other way.
241 bc = jinja2.MemcachedBytecodeCache(cache._cache,
242 "%sj2:" % settings.CACHE_PREFIX)
243 config['cache_size'] = -1 # Never clear the cache
244 config['bytecode_cache'] = bc
245 return config
246
716a9a0 [bug 576361] _lazy() strings are now extracted, and forums and questions
James Socol authored
247 # Let Tower know about our additional keywords.
248 # DO NOT import an ngettext variant as _lazy.
249 TOWER_KEYWORDS = {
250 '_lazy': None,
251 }
252
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in setting...
James Socol authored
253 # Tells the extract script what files to look for l10n in and what function
254 # handles the extraction. The Tower library expects this.
255 DOMAIN_METHODS = {
256 'messages': [
5d70383 Ignore the vendor lib for string extration.
James Socol authored
257 ('vendor/**', 'ignore'),
716a9a0 [bug 576361] _lazy() strings are now extracted, and forums and questions
James Socol authored
258 ('apps/forums/**', 'ignore'),
259 ('apps/questions/**', 'ignore'),
ce54806 Create a new chat app. [bug 605476]
James Socol authored
260 ('apps/chat/**', 'ignore'),
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in setting...
James Socol authored
261 ('apps/**.py',
262 'tower.management.commands.extract.extract_tower_python'),
263 ('**/templates/**.html',
264 'tower.management.commands.extract.extract_tower_template'),
265 ],
266 'lhtml': [
716a9a0 [bug 576361] _lazy() strings are now extracted, and forums and questions
James Socol authored
267 ('apps/forums/**', 'ignore'),
268 ('apps/questions/**', 'ignore'),
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in setting...
James Socol authored
269 ('**/templates/**.lhtml',
270 'tower.management.commands.extract.extract_tower_template'),
271 ],
272 'javascript': [
273 # We can't say **.js because that would dive into any libraries.
274 ('media/js/*.js', 'javascript'),
275 ],
276 }
277
eecf219 Staś Małolepszy [bug 554205] Localizing Javascript
stasm authored
278 # These domains will not be merged into messages.pot and will use separate PO
279 # files. See the following URL for an example of how to set these domains
280 # in DOMAIN_METHODS.
281 # http://github.com/jbalogh/zamboni/blob/d4c64239c24aa2f1e91276909823d1d1b290f0ee/settings.py#L254
282 STANDALONE_DOMAINS = [
283 'javascript',
284 ]
285
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in setting...
James Socol authored
286 # If you have trouble extracting strings with Tower, try setting this
287 # to True
fe7a058 Paul Craciunoiu Fix a bunch of pylint violations and make it shut up about some useless ...
pcraciunoiu authored
288 TOWER_ADD_HEADERS = True
c71ddce Adding translate-toolkit to requirements-dev.txt and settings in setting...
James Socol authored
289
5a79094 Moving css/js to minify.
James Socol authored
290 # Bundles for JS/CSS Minification
291 MINIFY_BUNDLES = {
292 'css': {
293 'common': (
86645ba Paul Craciunoiu [615354] Use mozilla/django-moz-header:
pcraciunoiu authored
294 'css/reset.css',
295 'global/headerfooter.css',
5a79094 Moving css/js to minify.
James Socol authored
296 'css/main.css',
297 'css/sidebar.css',
a4bd557 ricky rosario created forums css bundle and a forums/base.html to include it (bug 5680...
rlr authored
298 ),
299 'forums': (
eb2d19c Paul Craciunoiu Remove paginator.css, move datetimeformat helper to sumo app, use lists ...
pcraciunoiu authored
300 'css/forums.css',
5a79094 Moving css/js to minify.
James Socol authored
301 ),
8eb19c6 ricky rosario Implemented questions template (bug 565367)
rlr authored
302 'questions': (
da17b15 Paul Craciunoiu [604211] Delete and edit images and videos. Includes permissions.
pcraciunoiu authored
303 'css/to-delete.css',
8eb19c6 ricky rosario Implemented questions template (bug 565367)
rlr authored
304 'css/questions.css',
2babd7c Erik Rose [569285] Implement question tagging based on django-taggit, which has a ...
erikrose authored
305 'css/tags.css',
306 'css/jqueryui/jquery.ui.core.css',
307 'css/jqueryui/jquery.ui.autocomplete.css',
308 'css/jqueryui/jquery.ui.theme.css',
8eb19c6 ricky rosario Implemented questions template (bug 565367)
rlr authored
309 ),
5a79094 Moving css/js to minify.
James Socol authored
310 'search': (
311 'css/search.css',
312 ),
9eb84ce ricky rosario Some boilerplate for wiki app.
rlr authored
313 'wiki': (
314 'css/wiki.css',
1d71650 Erik Rose [603808] Built out infrastructure for the Localization (and Contributor)...
erikrose authored
315 # The dashboard app uses the wiki bundle because only the wiki app
316 # has the new theme at the moment.
317 'css/dashboards.css',
e664ef5 Paul Craciunoiu [600747] Video hook and render with Flash fallback.
pcraciunoiu authored
318 'css/screencast.css',
cc40a9a Erik Rose [575820] [602325] Implement nice tagging widget for KB document editing....
erikrose authored
319 'css/tags.css',
320 'css/jqueryui/jquery.ui.core.css',
321 'css/jqueryui/jquery.ui.autocomplete.css',
322 'css/jqueryui/jquery.ui.theme.css',
9eb84ce ricky rosario Some boilerplate for wiki app.
rlr authored
323 ),
8f58c81 Paul Craciunoiu [586478] New home page
pcraciunoiu authored
324 'home': (
325 'css/home.css',
326 ),
0d7b903 ricky rosario [bug 592671] Media and media gallery page
rlr authored
327 'gallery': (
da17b15 Paul Craciunoiu [604211] Delete and edit images and videos. Includes permissions.
pcraciunoiu authored
328 'css/to-delete.css',
0d7b903 ricky rosario [bug 592671] Media and media gallery page
rlr authored
329 'css/gallery.css',
330 ),
35c5fb7 Paul Craciunoiu Add breadcrumbs and use them throughout the site. Also fix test.
pcraciunoiu authored
331 'ie': (
332 'css/ie.css',
333 ),
f919dbd Customer Care templates
Alex Buchanan authored
334 'customercare': (
335 'css/jqueryui/jquery.ui.core.css',
336 'css/jqueryui/jquery.ui.theme.css',
337 'css/customercare.css',
338 ),
ce54806 Create a new chat app. [bug 605476]
James Socol authored
339 'chat': (
340 'css/chat.css',
341 ),
7213950 ricky rosario New users app for login, logout, and redirect (and more to come). [bug 6...
rlr authored
342 'users': (
343 'css/users.css',
344 ),
5a79094 Moving css/js to minify.
James Socol authored
345 },
346 'js': {
347 'common': (
8eb19c6 ricky rosario Implemented questions template (bug 565367)
rlr authored
348 'js/libs/jquery.min.js',
854f009 Paul Craciunoiu [615818] Upgrade modernizr to 1.6
pcraciunoiu authored
349 'js/libs/modernizr-1.6.min.js',
86645ba Paul Craciunoiu [615354] Use mozilla/django-moz-header:
pcraciunoiu authored
350 'global/menu.js',
c8e175c Paul Craciunoiu New thread and new reply validation: display errors. Includes tests and ...
pcraciunoiu authored
351 'js/main.js',
5a79094 Moving css/js to minify.
James Socol authored
352 ),
8eb19c6 ricky rosario Implemented questions template (bug 565367)
rlr authored
353 'questions': (
2babd7c Erik Rose [569285] Implement question tagging based on django-taggit, which has a ...
erikrose authored
354 'js/libs/jqueryui.min.js',
5495c6e Paul Craciunoiu [578520] Add preliminary support for uploading images and basic tests. U...
pcraciunoiu authored
355 'js/markup.js',
e69dbc7 Paul Craciunoiu [595376] Upload frontend for images and videos in the gallery
pcraciunoiu authored
356 'js/libs/jquery.ajaxupload.js',
6bb15f7 Paul Craciunoiu [614011] AAQ login/register, now its own page.
pcraciunoiu authored
357 'js/libs/jquery.modal.js',
5495c6e Paul Craciunoiu [578520] Add preliminary support for uploading images and basic tests. U...
pcraciunoiu authored
358 'js/upload.js',
359 'js/questions.js',
2babd7c Erik Rose [569285] Implement question tagging based on django-taggit, which has a ...
erikrose authored
360 'js/tags.js',
8eb19c6 ricky rosario Implemented questions template (bug 565367)
rlr authored
361 ),
5a79094 Moving css/js to minify.
James Socol authored
362 'search': (
8eb19c6 ricky rosario Implemented questions template (bug 565367)
rlr authored
363 'js/libs/jqueryui.min.js',
5a79094 Moving css/js to minify.
James Socol authored
364 'js/search.js',
365 ),
d2a3a06 Add quick markup buttons to editor (bug 563986)
Joshua Gross authored
366 'forums': (
367 'js/markup.js',
adfc4b7 ricky rosario * Refactored Marky for easier customization between the different apps
rlr authored
368 'js/forums.js',
9eb84ce ricky rosario Some boilerplate for wiki app.
rlr authored
369 ),
e69dbc7 Paul Craciunoiu [595376] Upload frontend for images and videos in the gallery
pcraciunoiu authored
370 'gallery': (
371 'js/libs/jquery.ajaxupload.js',
372 'js/gallery.js',
373 ),
9eb84ce ricky rosario Some boilerplate for wiki app.
rlr authored
374 'wiki': (
adfc4b7 ricky rosario * Refactored Marky for easier customization between the different apps
rlr authored
375 'js/markup.js',
2899747 Paul Craciunoiu [592100] Adding slug for documents and use it for internal links
pcraciunoiu authored
376 'js/libs/django/urlify.js',
377 'js/libs/django/prepopulate.js',
905cbe4 Erik Rose [597254] Implement sticky OS and browser selection on KB documents.
erikrose authored
378 'js/libs/jquery.cookie.js',
da74a18 Erik Rose [597252] Build browser/version and OS sniffing for document pages.
erikrose authored
379 'js/browserdetect.js',
e664ef5 Paul Craciunoiu [600747] Video hook and render with Flash fallback.
pcraciunoiu authored
380 'js/libs/swfobject.js',
3519247 ricky rosario Styled the "Help with:" selects. Uses jquery.selectbox plugin. [bug 6073...
rlr authored
381 'js/libs/jquery.selectbox-1.2.js',
3a77be4 Paul Craciunoiu [609027] Video modal
pcraciunoiu authored
382 'js/libs/jquery.modal.js',
89a38e2 Paul Craciunoiu Also fix broken JS on home page after minification.
pcraciunoiu authored
383 'js/screencast.js',
905cbe4 Erik Rose [597254] Implement sticky OS and browser selection on KB documents.
erikrose authored
384 'js/wiki.js',
cc40a9a Erik Rose [575820] [602325] Implement nice tagging widget for KB document editing....
erikrose authored
385 'js/libs/jqueryui.min.js',
386 'js/tags.js',
9eb84ce ricky rosario Some boilerplate for wiki app.
rlr authored
387 ),
f919dbd Customer Care templates
Alex Buchanan authored
388 'customercare': (
389 'js/libs/jqueryui.min.js',
390 'js/libs/jquery.NobleCount.js',
591d886 Customer Care, when prompting for auth, remember which tweet a user is r...
Alex Buchanan authored
391 'js/libs/jquery.cookie.js',
ce9fafc Fred Wenzel Infinite scrolling for Customer Care page. Bug 606342.
fwenzel authored
392 'js/libs/jquery.bullseye-1.0.min.js',
f919dbd Customer Care templates
Alex Buchanan authored
393 'js/customercare.js',
394 ),
ce54806 Create a new chat app. [bug 605476]
James Socol authored
395 'chat': (
396 'js/chat.js',
397 ),
5f41630 Paul Craciunoiu [bug 617096] Better public emails.
pcraciunoiu authored
398 'users': (
399 'js/users.js',
400 ),
5a79094 Moving css/js to minify.
James Socol authored
401 },
402 }
403
404 JAVA_BIN = '/usr/bin/java'
405
406 #
7b452cb Change Kitsune session behavior (bug 567297)
Joshua Gross authored
407 # Session cookies
408 SESSION_COOKIE_SECURE = True
409 SESSION_EXPIRE_AT_BROWSER_CLOSE = True
410
411 #
1f39be2 adding sphinx configs to settings.py
James Socol authored
412 # Connection information for Sphinx search
413 SPHINX_HOST = '127.0.0.1'
9231955 Changing the sphinx port to not overlap with AMO's default for testing.
James Socol authored
414 SPHINX_PORT = 3381
559c348 More handy updates to Sphinx tests, thanks to Dave.
James Socol authored
415 SPHINXQL_PORT = 3382
603141f new adding settings for search forum thread weight decay
James Socol authored
416
a927cfb Build scripts!
James Socol authored
417 SPHINX_INDEXER = '/usr/bin/indexer'
418 SPHINX_SEARCHD = '/usr/bin/searchd'
8e39688 Adding in the machinery to do sphinx tests
James Socol authored
419 SPHINX_CONFIG_PATH = path('configs/sphinx/sphinx.conf')
420
559c348 More handy updates to Sphinx tests, thanks to Dave.
James Socol authored
421 TEST_SPHINX_PATH = path('tmp/test/sphinx')
422 TEST_SPHINX_PORT = 3416
423 TEST_SPHINXQL_PORT = 3418
424
603141f new adding settings for search forum thread weight decay
James Socol authored
425 #
426 # Sphinx results tweaking
8eb19c6 ricky rosario Implemented questions template (bug 565367)
rlr authored
427 SEARCH_FORUM_MIN_AGE = 7 # age before which decay doesn't apply, in days
428 SEARCH_FORUM_HALF_LIFE = 14 # controls the decay rate, in days
bbd7660 use settings for SEARCH_MAX_RESULTS
James Socol authored
429 SEARCH_MAX_RESULTS = 1000
d72455a Rename a few settings from SPHINX_* to SEARCH_*
James Socol authored
430 SEARCH_RESULTS_PER_PAGE = 10
431
6667c90 Fixing errors found by check.py
James Socol authored
432 #
d72455a Rename a few settings from SPHINX_* to SEARCH_*
James Socol authored
433 # Search default settings
2b7a896 Erik Rose [579205] Implement search-based article suggestions when asking a new qu...
erikrose authored
434 # comma-separated tuple of included category IDs. Negative IDs are excluded.
44cb5fe Paul Craciunoiu Update categories: Navigation, How to, and renumbering.
pcraciunoiu authored
435 SEARCH_DEFAULT_CATEGORIES = (10, 20,)
33fbc03 Paul Craciunoiu move __init__ to common SearchClient and define constant for multiplier
pcraciunoiu authored
436 SEARCH_SUMMARY_LENGTH = 275
437 # because of markup cleanup, search summaries lengths vary quite a bit
438 # so we extract longer excerpts and perform truncation to the length above
439 SEARCH_SUMMARY_LENGTH_MULTIPLIER = 1.3
08c5ea1 Set 15-minute expires headers on search result pages (bug 564379)
Joshua Gross authored
440
441 #
442 # The length for which we would like the user to cache search forms and
443 # results, in minutes.
444 SEARCH_CACHE_PERIOD = 15
df36d80 Paul Craciunoiu Adding authority, with jinja filter and permission checks. Lots of tests...
pcraciunoiu authored
445
6c20d6c Paul Craciunoiu [596116] Unicode in filenames now supported in upload app. And more.
pcraciunoiu authored
446 # Maximum length of the filename. Forms should use this and raise
447 # ValidationError if the length is exceeded.
448 # @see http://code.djangoproject.com/ticket/9893
449 # Columns are 250 but this leaves 50 chars for the upload_to prefix
450 MAX_FILENAME_LENGTH = 200
451 MAX_FILEPATH_LENGTH = 250
cdd1871 Paul Craciunoiu [bug 596116] Rename uploaded files to something in ascii.
pcraciunoiu authored
452 # Default storage engine - ours does not preserve filenames
453 DEFAULT_FILE_STORAGE = 'upload.storage.RenameFileStorage'
6c20d6c Paul Craciunoiu [596116] Unicode in filenames now supported in upload app. And more.
pcraciunoiu authored
454
df36d80 Paul Craciunoiu Adding authority, with jinja filter and permission checks. Lots of tests...
pcraciunoiu authored
455 # Auth and permissions related constants
7213950 ricky rosario New users app for login, logout, and redirect (and more to come). [bug 6...
rlr authored
456 LOGIN_URL = '/users/login'
457 LOGOUT_URL = '/users/logout'
458 LOGIN_REDIRECT_URL = "/"
459 LOGOUT_REDIRECT_URL = "/"
460 REGISTER_URL = '/users/register'
e664ef5 Paul Craciunoiu [600747] Video hook and render with Flash fallback.
pcraciunoiu authored
461 WIKI_VIDEO_WIDTH = 640
462 WIKI_VIDEO_HEIGHT = 480
a9f19fc Starting the notifications app (bug 563991)
James Socol authored
463
58b33d7 Paul Craciunoiu [582847] Add upload limit (1MB) and enforce it. Also fix up some JS quir...
pcraciunoiu authored
464 IMAGE_MAX_FILESIZE = 1048576 # 1 megabyte, in bytes
8d9a069 Paul Craciunoiu [578520] Delete images and upload with no JS, thumbnail generation and I...
pcraciunoiu authored
465 THUMBNAIL_SIZE = 120 # Thumbnail size, in pixels
466 THUMBNAIL_UPLOAD_PATH = 'uploads/images/thumbnails/'
467 IMAGE_UPLOAD_PATH = 'uploads/images/'
468 # A string listing image mime types to accept, comma separated.
469 # String must not contain double quotes!
470 IMAGE_ALLOWED_MIMETYPES = 'image/jpeg,image/png,image/gif'
5495c6e Paul Craciunoiu [578520] Add preliminary support for uploading images and basic tests. U...
pcraciunoiu authored
471
2b7a896 Erik Rose [579205] Implement search-based article suggestions when asking a new qu...
erikrose authored
472 # Max number of wiki pages or other questions to suggest might answer the
473 # question you're about to ask
474 QUESTIONS_MAX_SUGGESTIONS = 5
475 # Number of extra suggestion results to pull from Sphinx to make up for
476 # possibly deleted wiki pages or question. To be safe, set this to the number
477 # of things that could be deleted between indexer runs.
478 QUESTIONS_SUGGESTION_SLOP = 3
479
a9f19fc Starting the notifications app (bug 563991)
James Socol authored
480 # Email
481 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
482
3a929b1 Server-side read-only implementation, thanks Jeff! [bug 570284]
James Socol authored
483
484 # Read-only mode setup.
485 READ_ONLY = False
486
487 # Turn on read-only mode in settings_local.py by putting this line
488 # at the VERY BOTTOM: read_only_mode(globals())
489 def read_only_mode(env):
490 env['READ_ONLY'] = True
491
492 # Replace the default (master) db with a slave connection.
493 if not env.get('SLAVE_DATABASES'):
494 raise Exception("We need at least one slave database.")
495 slave = env['SLAVE_DATABASES'][0]
496 env['DATABASES']['default'] = env['DATABASES'][slave]
497
498 # No sessions without the database, so disable auth.
499 env['AUTHENTICATION_BACKENDS'] = ()
500
501 # Add in the read-only middleware before csrf middleware.
502 extra = 'sumo.middleware.ReadOnlyMiddleware'
503 before = 'django.middleware.csrf.CsrfViewMiddleware'
504 m = list(env['MIDDLEWARE_CLASSES'])
505 m.insert(m.index(before), extra)
506 env['MIDDLEWARE_CLASSES'] = tuple(m)
507
508
a9f19fc Starting the notifications app (bug 563991)
James Socol authored
509 # Celery
fca0843 [bug 578067] Upgrade to celery 2
James Socol authored
510 import djcelery
511 djcelery.setup_loader()
512
a9f19fc Starting the notifications app (bug 563991)
James Socol authored
513 BROKER_HOST = 'localhost'
514 BROKER_PORT = 5672
515 BROKER_USER = 'kitsune'
516 BROKER_PASSWORD = 'kitsune'
517 BROKER_VHOST = 'kitsune'
518 CELERY_RESULT_BACKEND = 'amqp'
519 CELERY_IGNORE_RESULT = True
79acb5f Notifications app tests
James Socol authored
520 CELERY_ALWAYS_EAGER = True # For tests. Set to False for use.
77760ab Push Celery logs to syslog, for real this time.
James Socol authored
521 CELERY_SEND_TASK_ERROR_EMAILS = True
522 CELERYD_LOG_LEVEL = logging.INFO
523 CELERYD_CONCURRENCY = 4
1fc72d3 ricky rosario Implemented voting for questions / "I have this problem too" (bug 573072...
rlr authored
524
7c24fb4 A KB-rebuild task. [bug 589853]
James Socol authored
525 # Wiki rebuild settings
526 WIKI_REBUILD_TOKEN = 'sumo:wiki:full-rebuild'
527 WIKI_REBUILD_ON_DEMAND = False
528
1fc72d3 ricky rosario Implemented voting for questions / "I have this problem too" (bug 573072...
rlr authored
529 # Anonymous user cookie
530 ANONYMOUS_COOKIE_NAME = 'SUMO_ANONID'
531 ANONYMOUS_COOKIE_MAX_AGE = 30 * 86400 # Seconds
d17cdd7 ricky rosario Implemented top contributors list (bug 573075)
rlr authored
532
533 # Top contributors cache settings
534 TOP_CONTRIBUTORS_CACHE_KEY = 'sumo:TopContributors'
535 TOP_CONTRIBUTORS_CACHE_TIMEOUT = 60 * 60 * 12
0298e71 Erik Rose Start wiki app and add skeletal models.
erikrose authored
536
45c4b99 Erik Rose Make firefox_versions and operating_systems delegate to the parent docum...
erikrose authored
537 # Do not change this without also deleting all wiki documents:
0298e71 Erik Rose Start wiki app and add skeletal models.
erikrose authored
538 WIKI_DEFAULT_LANGUAGE = LANGUAGE_CODE
28061e0 Paul Craciunoiu [592670] Media gallery models: a gallery app
pcraciunoiu authored
539
540 # Gallery settings
541 GALLERY_DEFAULT_LANGUAGE = WIKI_DEFAULT_LANGUAGE
542 GALLERY_IMAGE_PATH = 'uploads/gallery/images/'
543 GALLERY_IMAGE_THUMBNAIL_PATH = 'uploads/gallery/images/thumbnails/'
544 GALLERY_VIDEO_PATH = 'uploads/gallery/videos/'
b51d8b5 Paul Craciunoiu [613329] Videos can link to CDN if setting provided.
pcraciunoiu authored
545 GALLERY_VIDEO_URL = None
28061e0 Paul Craciunoiu [592670] Media gallery models: a gallery app
pcraciunoiu authored
546 GALLERY_VIDEO_THUMBNAIL_PATH = 'uploads/gallery/videos/thumbnails/'
9d356ed Paul Craciunoiu Add chowse's video thumbnail placeholder and use it.
pcraciunoiu authored
547 GALLERY_VIDEO_THUMBNAIL_PROGRESS_URL = MEDIA_URL + 'img/video-thumb.png'
e69dbc7 Paul Craciunoiu [595376] Upload frontend for images and videos in the gallery
pcraciunoiu authored
548 THUMBNAIL_PROGRESS_WIDTH = 32 # width of the above image
549 THUMBNAIL_PROGRESS_HEIGHT = 32 # height of the above image
57f3f56 Paul Craciunoiu [592674] Media gallery uploads backend
pcraciunoiu authored
550 VIDEO_MAX_FILESIZE = 16777216 # 16 megabytes, in bytes
78f55c9 Fred Wenzel Customer Care is born. Tweet collection included!
fwenzel authored
551
a6f1910 Fred Wenzel Show tweet statistics in the Customer Care sidebar. Bugs 612952, 612966,...
fwenzel authored
552 # Customer Care settings
553 CC_MAX_TWEETS = 500 # Max. no. of tweets in DB
554 CC_TWEETS_PERPAGE = 100 # How many tweets to collect in one go. Max: 100.
555 CC_SHOW_REPLIES = True # Show replies to tweets?
f919dbd Customer Care templates
Alex Buchanan authored
556
a6f1910 Fred Wenzel Show tweet statistics in the Customer Care sidebar. Bugs 612952, 612966,...
fwenzel authored
557 CC_TWEET_ACTIVITY_URL = 'https://metrics.mozilla.com/stats/twitter/armyOfAwesomeKillRate.json' # Tweet activity stats
558 CC_TOP_CONTRIB_URL = 'https://metrics.mozilla.com/stats/twitter/armyOfAwesomeTopSoldiers.json' # Top contributor stats
559 CC_TWEET_ACTIVITY_CACHE_KEY = 'sumo-cc-tweet-stats'
560 CC_TOP_CONTRIB_CACHE_KEY = 'sumo-cc-top-contrib-stats'
561 CC_STATS_CACHE_TIMEOUT = 24 * 60 * 60 # 24 hours
f8b4bf3 Fred Wenzel Warn if Customercare stats data is outdated. Bug 612966.
fwenzel authored
562 CC_STATS_WARNING = 30 * 60 * 60 # Warn if JSON data is older than 30 hours
fe2ece3 Fred Wenzel Make list of ignored users changeable in the settings. Bug 617095.
fwenzel authored
563 CC_IGNORE_USERS = ['fx4status',] # User names whose tweets to ignore.
1013db8 Fred Wenzel CC_SHOW_REPLIES setting to switch off showing tweet replies if necessary...
fwenzel authored
564
f919dbd Customer Care templates
Alex Buchanan authored
565 TWITTER_CONSUMER_KEY = ''
566 TWITTER_CONSUMER_SECRET = ''
8a85a71 ricky rosario Added `ready for review` notification [bug 599022]
rlr authored
567
a6f1910 Fred Wenzel Show tweet statistics in the Customer Care sidebar. Bugs 612952, 612966,...
fwenzel authored
568
8a85a71 ricky rosario Added `ready for review` notification [bug 599022]
rlr authored
569 NOTIFICATIONS_FROM_ADDRESS = 'notifications@support.mozilla.com'
ce54806 Create a new chat app. [bug 605476]
James Socol authored
570
571 # URL of the chat server.
572 CHAT_SERVER = 'https://chat-support.mozilla.com:9091'
573 CHAT_CACHE_KEY = 'sumo-chat-queue-status'
Something went wrong with that request. Please try again.