2009-04-12 11:50:47 +08:00
|
|
|
# coding: utf-8
|
2007-09-17 22:48:33 +08:00
|
|
|
from os import path
|
|
|
|
|
|
|
|
from django.conf.urls.defaults import *
|
2007-09-19 21:26:56 +08:00
|
|
|
|
2007-09-17 22:48:33 +08:00
|
|
|
import views
|
|
|
|
|
2008-07-19 03:45:00 +08:00
|
|
|
|
2007-09-17 22:48:33 +08:00
|
|
|
base_dir = path.dirname(path.abspath(__file__))
|
|
|
|
media_dir = path.join(base_dir, 'media')
|
|
|
|
locale_dir = path.join(base_dir, 'locale')
|
|
|
|
|
|
|
|
js_info_dict = {
|
|
|
|
'domain': 'djangojs',
|
|
|
|
'packages': ('regressiontests.views',),
|
|
|
|
}
|
|
|
|
|
2010-12-13 21:52:52 +08:00
|
|
|
js_info_dict_english_translation = {
|
|
|
|
'domain': 'djangojs',
|
|
|
|
'packages': ('regressiontests.views.app0',),
|
|
|
|
}
|
|
|
|
|
2010-05-13 21:29:31 +08:00
|
|
|
js_info_dict_multi_packages1 = {
|
|
|
|
'domain': 'djangojs',
|
|
|
|
'packages': ('regressiontests.views.app1', 'regressiontests.views.app2'),
|
|
|
|
}
|
|
|
|
|
|
|
|
js_info_dict_multi_packages2 = {
|
|
|
|
'domain': 'djangojs',
|
|
|
|
'packages': ('regressiontests.views.app3', 'regressiontests.views.app4'),
|
|
|
|
}
|
|
|
|
|
2007-09-17 22:48:33 +08:00
|
|
|
urlpatterns = patterns('',
|
|
|
|
(r'^$', views.index_page),
|
2008-07-19 03:45:00 +08:00
|
|
|
|
2007-09-19 21:26:56 +08:00
|
|
|
# Default views
|
2007-09-17 22:48:33 +08:00
|
|
|
(r'^shortcut/(\d+)/(.*)/$', 'django.views.defaults.shortcut'),
|
|
|
|
(r'^non_existing_url/', 'django.views.defaults.page_not_found'),
|
|
|
|
(r'^server_error/', 'django.views.defaults.server_error'),
|
2008-07-19 03:45:00 +08:00
|
|
|
|
2011-04-02 21:27:40 +08:00
|
|
|
# a view that raises an exception for the debug view
|
|
|
|
(r'^raises/$', views.raises),
|
|
|
|
(r'^raises404/$', views.raises404),
|
|
|
|
|
2007-09-19 21:26:56 +08:00
|
|
|
# i18n views
|
2008-07-19 03:45:00 +08:00
|
|
|
(r'^i18n/', include('django.conf.urls.i18n')),
|
2007-09-17 22:48:33 +08:00
|
|
|
(r'^jsi18n/$', 'django.views.i18n.javascript_catalog', js_info_dict),
|
2010-12-13 21:52:52 +08:00
|
|
|
(r'^jsi18n_english_translation/$', 'django.views.i18n.javascript_catalog', js_info_dict_english_translation),
|
2010-05-13 21:29:31 +08:00
|
|
|
(r'^jsi18n_multi_packages1/$', 'django.views.i18n.javascript_catalog', js_info_dict_multi_packages1),
|
|
|
|
(r'^jsi18n_multi_packages2/$', 'django.views.i18n.javascript_catalog', js_info_dict_multi_packages2),
|
2008-07-19 03:45:00 +08:00
|
|
|
|
2007-09-19 21:26:56 +08:00
|
|
|
# Static views
|
2007-09-17 22:48:33 +08:00
|
|
|
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': media_dir}),
|
2010-03-03 03:37:48 +08:00
|
|
|
)
|
|
|
|
|
2010-03-08 23:20:29 +08:00
|
|
|
urlpatterns += patterns('regressiontests.views.views',
|
|
|
|
url(r'view_exception/(?P<n>\d+)/$', 'view_exception', name='view_exception'),
|
2010-03-09 01:01:21 +08:00
|
|
|
url(r'template_exception/(?P<n>\d+)/$', 'template_exception', name='template_exception'),
|
2011-01-21 06:33:58 +08:00
|
|
|
url(r'^raises_template_does_not_exist/$', 'raises_template_does_not_exist', name='raises_template_does_not_exist'),
|
2010-09-11 11:13:23 +08:00
|
|
|
)
|