Answer the question
In order to leave comments, you need to log in
Django - url generation issue?
The project has a bunch of templates, all URLs are built using the standard {% url %} tag. Some of the urls, say, look like this:
urlpatterns = patterns("",<br>
(r'^factory/(?P<fac>\d+)/', include(patterns('',<br>
(r'^$', factory.index),<br>
(r'^assembly/(?P<asm>\d+)/$', factory.assembly),<br>
(r'^division/(?P<div>\d+)/$', factory.division),<br>
(r'^division/(?P<div>\d+)/assembly/(?P<asm>\d+)/$', factory.assembly),<br>
))),<br>
)
urlpatterns = patterns("",<br>
(r'^', include(patterns('',<br>
……<br>
)), {'fac': 'from_subdomain'}),<br>
)
urlpatterns = patterns("",<br>
(r'^(?:factory/(?P<fac>\d+)/)?', include(patterns('',<br>
……<br>
)), {'fac': 'from_subdomain'}),<br>
)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question