How can I get the reverse url for a Django Flatpages template
You need to redeclare the url conf and cannot rely on the official 'django.contrib.flatpages.urls'
that the doc is encouraging us to use.
This won't be more difficult, just include in your urls.py
from django.conf.urls import patterns, url
urlpatterns += patterns('',
...
url(r'^pages(?P.*)$', 'django.contrib.flatpages.views.flatpage', name='flatpage'),
...
)
And now you can use your usual reverse url template tag
About Us
Or to display a list of all flat pages
{% get_flatpages as flatpages %}
{% for page in flatpages %}
- {{ page.title }}
{% endfor %}