The Django PageView Application
March 2006 | Fredrik Lundh
This is a work in progress.
The pageview mini application is a fast and efficient dynamic front-end renderer, which can reformat HTML and XHTML pages from external sources on the fly. This can be useful when you want to:
- publish information from an existing content management system
- republish pages from an external source
- use a standard wiki to maintain the site, behind the scenes
- allow users to choose between different templates, depending on preferences or user agent.
- experiment with different styles, without having to generate multiple copies of an entire site.
The application uses tidy to clean up the source material as
to pull out relevant XHTML fragments from it. Django’s
engine (dead link) is then used to render output pages,
system (dead link) is used to cache rendered pages in memory (e.g. via
The application maintains a page mapping database which controls
how URL are mapped to individual pages. You can use Django’s
administration interface (dead link) to remap or redirect pages. Since each page has an entry
in this database, you can add Django
and other features to any or all pages on the site.
The code is currently only available via subversion:
$ svn co http://svn.effbot.org/public/pydotorg/page
For installation tips, see
this article (dead link).
The current version is written for Django 0.91, and includes sample parsers for old-style www.python.org contents, latex-generated docs.python.org pages, effbot.org zone articles, pyref and pyfaq pages, and pages rendered in moinmoin‘s default style.
Here are some samples rendered with a python.org-style template:
asyncore — Asynchronous socket handler (dead link)” (from the pyref project),
“ Can’t find what you’re looking for? (dead link)“,
“ Why Work on Python? (dead link)“, and
“ PythonDoc (dead link)” (from effbot.org).