I cannot get flatpages to work on my site, although I have done all
that I can see in the documentation, and would like guidance.

I give a 6-step short description of what I've done and what happened,
in case anyone recognizes a glaring mistake or lack in what I've done.
Step 6 is it just 'not working'. I can get static pages working Ok.

Thank you for any help that you can give me.

Regards,
Geoff

1) Create settings for flatpages in settings.py

settings.py
-----------

...
SITE_ID = 1
...

MIDDLEWARE_CLASSES = (
    ...
    'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
)
....
INSTALLED_APPS = (
    ...
    'django.contrib.sites',
    'django.contrib.flatpages',
)

2) Create a template for flatpages in flatpages/default.html

templates/flatpages/default.html
--------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
    "http://www.w3.org/TR/REC-html40/loose.dtd";>
<html>
  <head>
    <title> {{ flatpage.title }} </title>
  </head>
  <body>
    <p> {{ flatpage.content }} </p>
  </body>
</html>

3) Create a path for flatpages in urls.py
(this is not specified in the documentation but would seem to be
needed as shown in the cwiw site.
I've tried it with and without, and the without just means that all
other paths are tried first during DEBUG)

urls.py
-------
urlpatterns = patterns('',
    ...
    (r'', include('django.contrib.flatpages.urls')),
)

4) Create a flatpage in the admin console

browse to:
  http://mysite/admin/flatpages/flatpage/1/

create
  URL: /info/
  Title: Information
  Content: Some Info

and
  Sites: mysite

5) Test that an arbitrary URL creates a 404.

browse to:
  http://mysite/in/
    I get a genuine 404 error. In DEBUG mode it says "No FlatPage
matches the given query."

6) Test that the info URL creates works (IT DOESN'T!)

browse to:
  http://mysite/info/
    I again get a genuine 404 error. In DEBUG mode it again says "No
FlatPage matches the given query."
    I would expect that my flatpage would now show.



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to