kitsune/urls.py

48 строки
1.4 KiB
Python
Исходник Обычный вид История

2010-07-01 02:24:01 +04:00
from django.conf.urls.defaults import include, patterns, url
from django.conf import settings
from django.contrib import admin
2010-07-01 02:24:01 +04:00
from django.views.i18n import javascript_catalog
from django.views.decorators.cache import cache_page
import authority
2010-02-04 02:09:30 +03: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')),
(r'^questions', include('questions.urls')),
(r'^notifications', include('notifications.urls')),
(r'^flagged', include('flagit.urls')),
(r'^upload', include('upload.urls')),
2010-08-19 21:19:17 +04:00
(r'^kb', include('wiki.urls')),
(r'^gallery', include('gallery.urls')),
2010-09-24 16:24:28 +04:00
(r'^army-of-awesome', include('customercare.urls')),
(r'^chat', include('chat.urls')),
# Kitsune admin (not Django admin).
(r'^admin/', include('kadmin.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'),
2010-10-19 02:56:53 +04:00
url(r'^', include('dashboards.urls')),
# Users
('', include('users.urls')),
2010-02-04 02:09:30 +03:00
)
# Handle 404 and 500 errors
handler404 = 'sumo.views.handle404'
2010-04-28 21:26:28 +04:00
handler500 = 'sumo.views.handle500'
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}),
)