2010-07-01 02:24:01 +04:00
|
|
|
from django.conf.urls.defaults import include, patterns, url
|
2010-02-08 22:45:49 +03:00
|
|
|
from django.conf import settings
|
2010-05-19 06:00:23 +04:00
|
|
|
from django.contrib import admin
|
2010-07-01 02:24:01 +04:00
|
|
|
from django.views.i18n import javascript_catalog
|
2010-07-21 01:01:46 +04:00
|
|
|
from django.views.decorators.cache import cache_page
|
2010-05-19 06:00:23 +04:00
|
|
|
|
2011-03-04 04:05:11 +03:00
|
|
|
from adminplus import AdminSitePlus
|
2010-05-15 05:10:59 +04:00
|
|
|
import authority
|
2011-04-20 02:18:51 +04:00
|
|
|
from waffle.views import wafflejs
|
2010-05-19 06:00:23 +04:00
|
|
|
|
2010-02-04 02:09:30 +03:00
|
|
|
|
2011-03-04 04:05:11 +03:00
|
|
|
admin.site = AdminSitePlus()
|
2010-05-15 05:10:59 +04:00
|
|
|
admin.autodiscover()
|
|
|
|
authority.autodiscover()
|
2010-02-04 02:09:30 +03:00
|
|
|
|
|
|
|
urlpatterns = patterns('',
|
2010-04-24 01:08:50 +04:00
|
|
|
(r'^search', include('search.urls')),
|
|
|
|
(r'^forums', include('forums.urls')),
|
2010-05-12 06:01:13 +04:00
|
|
|
(r'^questions', include('questions.urls')),
|
2010-07-20 01:15:39 +04:00
|
|
|
(r'^flagged', include('flagit.urls')),
|
2010-07-15 05:54:41 +04:00
|
|
|
(r'^upload', include('upload.urls')),
|
2010-08-19 21:19:17 +04:00
|
|
|
(r'^kb', include('wiki.urls')),
|
2010-09-09 00:41:23 +04:00
|
|
|
(r'^gallery', include('gallery.urls')),
|
2010-09-24 16:24:28 +04:00
|
|
|
(r'^army-of-awesome', include('customercare.urls')),
|
2010-10-21 03:40:09 +04:00
|
|
|
(r'^chat', include('chat.urls')),
|
2011-01-13 23:24:21 +03:00
|
|
|
(r'^1', include('inproduct.urls')),
|
2011-03-03 04:11:30 +03:00
|
|
|
(r'^postcrash', include('postcrash.urls')),
|
2010-06-18 19:57:39 +04:00
|
|
|
|
|
|
|
# Kitsune admin (not Django admin).
|
2011-03-04 04:05:11 +03:00
|
|
|
(r'^admin/', include(admin.site.urls)),
|
2010-07-01 02:24:01 +04:00
|
|
|
|
|
|
|
# Javascript translations.
|
2010-10-19 02:56:53 +04:00
|
|
|
url(r'^jsi18n/.*$', cache_page(60 * 60 * 24 * 365)(javascript_catalog),
|
2010-07-01 02:24:01 +04:00
|
|
|
{'domain': 'javascript', 'packages': ['kitsune']}, name='jsi18n'),
|
2011-04-20 02:18:51 +04:00
|
|
|
# JavaScript Waffle.
|
|
|
|
url(r'^wafflejs$', wafflejs, name='wafflejs'),
|
2010-10-19 02:56:53 +04:00
|
|
|
|
2011-04-15 19:29:53 +04:00
|
|
|
# Deprecated URLs.
|
|
|
|
(r'^forum', include('forums.old_urls')),
|
|
|
|
|
2011-03-17 03:11:05 +03:00
|
|
|
(r'^', include('dashboards.urls')),
|
|
|
|
(r'^', include('landings.urls')),
|
2011-03-25 03:04:50 +03:00
|
|
|
(r'^', include('tidings.urls')), # Keep short for email wrapping.
|
2010-11-22 23:55:15 +03:00
|
|
|
|
|
|
|
# Users
|
|
|
|
('', include('users.urls')),
|
2010-12-30 23:15:46 +03:00
|
|
|
|
|
|
|
# Services and sundry.
|
|
|
|
(r'', include('sumo.urls')),
|
2010-02-04 02:09:30 +03:00
|
|
|
)
|
2010-02-08 22:45:49 +03:00
|
|
|
|
2010-04-28 07:50:55 +04:00
|
|
|
# Handle 404 and 500 errors
|
|
|
|
handler404 = 'sumo.views.handle404'
|
2010-04-28 21:26:28 +04:00
|
|
|
handler500 = 'sumo.views.handle500'
|
2010-04-28 07:50:55 +04:00
|
|
|
|
2010-02-08 22:45:49 +03:00
|
|
|
if settings.DEBUG:
|
|
|
|
media_url = settings.MEDIA_URL.lstrip('/').rstrip('/')
|
|
|
|
urlpatterns += patterns('',
|
|
|
|
(r'^%s/(?P<path>.*)$' % media_url, 'django.views.static.serve',
|
|
|
|
{'document_root': settings.MEDIA_ROOT}),
|
|
|
|
)
|