2014-04-02 08:46:34 +08:00
|
|
|
import warnings
|
|
|
|
|
2011-09-12 06:36:16 +08:00
|
|
|
from django.conf.urls import patterns, url, include
|
2011-10-14 05:34:56 +08:00
|
|
|
|
|
|
|
from .namespace_urls import URLObject
|
|
|
|
from .views import view_class_instance
|
|
|
|
|
2009-07-17 00:16:13 +08:00
|
|
|
|
|
|
|
testobj3 = URLObject('testapp', 'test-ns3')
|
|
|
|
|
2014-04-02 08:46:34 +08:00
|
|
|
# test deprecated patterns() function. convert to list of urls() in Django 2.0
|
|
|
|
with warnings.catch_warnings(record=True) as w:
|
|
|
|
warnings.filterwarnings('ignore', module='django.conf.urls')
|
|
|
|
|
|
|
|
urlpatterns = patterns('urlpatterns_reverse.views',
|
|
|
|
url(r'^normal/$', 'empty_view', name='inc-normal-view'),
|
|
|
|
url(r'^normal/(?P<arg1>\d+)/(?P<arg2>\d+)/$', 'empty_view', name='inc-normal-view'),
|
2009-07-17 00:16:13 +08:00
|
|
|
|
2014-04-02 08:46:34 +08:00
|
|
|
url(r'^\+\\\$\*/$', 'empty_view', name='inc-special-view'),
|
2011-11-07 09:09:13 +08:00
|
|
|
|
2014-04-02 08:46:34 +08:00
|
|
|
url(r'^mixed_args/(\d+)/(?P<arg2>\d+)/$', 'empty_view', name='inc-mixed-args'),
|
|
|
|
url(r'^no_kwargs/(\d+)/(\d+)/$', 'empty_view', name='inc-no-kwargs'),
|
2010-08-05 15:09:47 +08:00
|
|
|
|
2014-04-02 08:46:34 +08:00
|
|
|
url(r'^view_class/(?P<arg1>\d+)/(?P<arg2>\d+)/$', view_class_instance, name='inc-view-class'),
|
2010-08-06 21:47:56 +08:00
|
|
|
|
2014-04-02 08:46:34 +08:00
|
|
|
(r'^test3/', include(testobj3.urls)),
|
|
|
|
(r'^ns-included3/', include('urlpatterns_reverse.included_urls', namespace='inc-ns3')),
|
|
|
|
(r'^ns-included4/', include('urlpatterns_reverse.namespace_urls', namespace='inc-ns4')),
|
|
|
|
)
|