Getting a ‘No FlatPage matches the given query’ error?
This may be useful if you are a Django newb. All others… this will probably be gibberish.
Are you are working through James Bennett’s ‘Practical Django Projects’ (second edition) and getting the above error when trying to view your first flatpage? This could be because you did not put leading and trailing forward slashes in the flatpage URL field when setting up your flatpage in the admin panel.
The book actually tells you to do this in the example it gives, but in my speed-reading I ignored the slashes and treated the URL field as though I was entering a wordpress page slug. Four hours, a django reinstall, and much angst later, I have relearned the lesson that it always pays to read the instructions carefully.
Perhaps you can avoid my mistake.
_______
Short URL for this post: http://wp.me/pnqr9-P
Paul 23:43 on Saturday, August 15, 2009 Permalink
I have put the slashes but still throwing the same error!!
/first-page/
Ben 16:24 on Monday, August 17, 2009 Permalink
Hmmm. When I was hunting around I saw a couple of other possible causes for this, but I suspect you’ve already come across those. From memory I eventually found the source of my problem by playing around in the admin panel – after changing the page title a few times and trying to view the page from the admin panel I realised django wasn’t rendering the url correctly. That at least narrowed it down to a pattern/url problem rather than there being no communication with the flatpage ap at all. Maybe a similar approach would help you narrow down the source of your issue.