I have annoying problems using django-sitetree (version 0.5.1) for generating a navigation menu with Django. For testing purposes I tried to configure django-sitetree to make a sitetree for the "Polls" app (official Django tutorial). I configured it according to some instructions answering a prior question - but i ran into trouble using url patterns, which didn't work for me.
So these are my url patterns for "Polls", which are included in /polls (I don't use trailing slashes):
urlpatterns = patterns('polls.views',
(r'^$', 'index'),
(r'^/(?P<poll_id>\d+)$', 'detail'),
(r'^/(?P<poll_id>\d+)/results$', 'results'),
(r'^/(?P<poll_id>\d+)/vote$', 'vote'),
)
I only configured the views index
and detail
like this via Django admin:
Title URL
My site /
+ Polls polls.views.index
+ Poll {{ poll.question } polls.views.detail poll.id
Which produces the following output using {% sitetree_menu from "maintree" include "trunk" %}
on my main page /
Title URL
My site /
+ Polls /polls
+ Poll #unresolved
But what I am expecting is:
Title URL
My site /
+ Polls /polls
+ Poll foo /polls/1
+ Poll Test #2 /polls/2
I have already tried several things like using named views in the urls.py (as recommended in the documentation), but i don't even get a simple {% sitetree_url %}
working with parameters. It's a pity to see that there's nothing helpful on the web except some copies of the answer mentioned above. I would appreciate it if anyone helped me out with a more detailed one. Thanks for your help!