2011-06-16 01:29:10 +08:00
|
|
|
from django.conf.urls.i18n import i18n_patterns
|
2018-12-08 06:52:28 +08:00
|
|
|
from django.urls import include, path, re_path
|
2017-01-27 03:58:33 +08:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2011-06-16 01:29:10 +08:00
|
|
|
from django.views.generic import TemplateView
|
|
|
|
|
|
|
|
view = TemplateView.as_view(template_name='dummy.html')
|
|
|
|
|
2014-04-02 08:46:34 +08:00
|
|
|
urlpatterns = [
|
2018-12-08 06:52:28 +08:00
|
|
|
path('not-prefixed/', view, name='not-prefixed'),
|
|
|
|
path('not-prefixed-include/', include('i18n.patterns.urls.included')),
|
|
|
|
re_path(_(r'^translated/$'), view, name='no-prefix-translated'),
|
|
|
|
re_path(_(r'^translated/(?P<slug>[\w-]+)/$'), view, name='no-prefix-translated-slug'),
|
2014-04-02 08:46:34 +08:00
|
|
|
]
|
2011-06-16 01:29:10 +08:00
|
|
|
|
2014-04-02 08:46:34 +08:00
|
|
|
urlpatterns += i18n_patterns(
|
2018-12-08 06:52:28 +08:00
|
|
|
path('prefixed/', view, name='prefixed'),
|
|
|
|
path('prefixed.xml', view, name='prefixed_xml'),
|
|
|
|
re_path(_(r'^users/$'), view, name='users'),
|
|
|
|
re_path(_(r'^account/'), include('i18n.patterns.urls.namespace', namespace='account')),
|
2011-06-16 01:29:10 +08:00
|
|
|
)
|