I'm trying out the flatpages app but not having a great deal of
success. I've followed the instructions at http://www.djangoproject.com/documentation/flatpages/.
I've added a directory in my templates folder (templates/flatpages/
default.html) according to the example in the documentation. I used
the admin interface to make a dummy page 'about' with a URL value of '/
about/' and my site selected for the page. However, when I try to
access the url (mysite.com/about/) I get an error saying that it tried
using the url patterns in urls.py but "The current URL, about/, didn't
match any of these." (I have DEBUG = True in settings.py). If I add:
(r'', include('django.contrib.flatpages.urls')),
to the urls.py, then I get an error saying "No FlatPage matches the
given query." What am I doing wrong? From the official documentation
it seems that I shouldn't have to add anything to urls.py, since
that's the whole point: flatpages catches the 404 error for url
patterns not found in urls.py then checks if there is a match in the
database and render the result or else re-raises the 404.
Thanks,
j-s
Did you add 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware'
to your ``MIDDLEWARE_CLASSES`` setting?
Jacob
(r'', include('django.contrib.flatpages.urls')),
If this is required, should I file a ticket on the documentation to
get this included in the instructions?
Thanks.
j-s
No, it's not; the fallback middleware works fine for me. If it's not
working for you, chances are you've got something misconfigured; why
don't you post your settings.py and we'll take a look?
Jacob