Python Web Objects 1.3 review

Download
by rbytes.net on

Python Web Objects is a dynamic page generation system that allows the developer to embed Python code inside HTML

License: BSD License
File size: 17K
Developer: James Turner
0 stars award from rbytes.net

Python Web Objects is a dynamic page generation system that allows the developer to embed Python code inside HTML. It is similar in function to what JSP is to Java. t's a module that runs under mod_python and the Apache webserver. It is designed to offer a good balance between a providing a clean way to integrate design content from code, while doing so as fast as possible.

Download the latest version, then read the documentation. If you're into antiques, you can always browse the archives, but there's no reason to use an old version.

To install PWO, first decompress the tarball you downloaded.
$ gunzip pwo-0.XX.tar.gz
$ tar xvf pwo-0.XX.tar

Then, copy the pwo.py module into some location in your PYTHONPATH. The proper location is usually /usr/local/lib/python2.x/site-packages/
$ cp pwo-0.XX/pwo.py /usr/local/lib/python2.2/site-packages/

PWO should now be ready to use.

To configure a directory to make PWO pages, you first need to make sure that the directory is visible on the web. Ask your friendly Apache sysadmin if you don't know what this means. In this document, the path you'll be keeping your .pwo files in is called /path/to/pwodir/, and its corresponding URL is http://yourserver/url/to/pwodir/.
Let Apache and mod_python know that the pwo.py will be handling requests to .pwo files in that directory. Do this by adding a few lines to our entry in your httpd.conf file.


AddHandler python-program .pwo
PythonHandler pwo
PythonDebug On



The PythonDebug directive is optional, but you will most likely want it enabled while you are developing. It will make exceptions print tracebacks to the browser in plain-text format. For security reasons, you should comment it out on production systems.
Now a file /path/to/pwodir/some_file.pwo will generate its page at http://yourserver/url/to/pwodir/some_file.pwo. Try copying a simple one of the included samples, like 'hello.pwo', to this directory to test your installation.
If you've never used PWO before, learn the syntax, and/or check out some sample pages.

Python Web Objects 1.3 search tags