i don't find any solution, how to get the url in template with the following configuration (using Django1.3):
urls.py
urlpatterns = patterns('',
url(r'^/foo/(?P<parameter>\d+)/$', include('bar.urls'), name='foo-url'),
)
Included url-conf:
bar.urls.py
urlpatterns = patterns('',
(r'^/bar/$', 'bar.views.index'),
url(r'^/bar/(?P<parameter2>\d+)/$', 'bar.views.detail', name='bar-url'),
)
bar.views.py
def detail(request, parameter, parameter2):
obj1 = Foo.objects.get(id=parameter)
obj2 = Bar.objects.get(id=parameter2)
Now I try to get the url in template with:
{% url bar-url parameter=1 parameter2=2 %}
I expect to get: /bar/1/foo/2/
Is it posible to use in this case the {% url %}?