How can I get the reverse url for a Django Flatpages template
I agree with Anentropic that there is no point in using Django Flatpages if you need to write urlconfs to employ them. It's much more straightforward to use generic views such as TemplateView directly:
from django.conf.urls import patterns, url
from django.views.generic import TemplateView
urlpatterns = patterns('',
url(r'^about/$', TemplateView.as_view(template_name="about.html"), name="about"),
)
Flatpages take advantage of FlatpageFallbackMiddleware, which catches 404 errors and tries to find content for requested url in your database. The major advantage is that you don't have to touch your templates directly each time you have to change something in them, the downside is the need to use a database :)
If you still choose to use Flatpages app, you'd better use get_flatpages template tag:
{% load flatpages %}
{% for page in get_flatpages %}
- {{ page.title }}
{% endfor %}
Personally, I rarely reference flatpages outside of website's main menu, which is included via {% include 'includes/nav.html' %} and looks like this:
I don't feel I violate any DRY KISS or something:)