Welcome to Nevow
This page contains examples of how to build web applications on top of Nevow, in order of increasing complexity. To get a feel of how to structure your Python code while using Nevow, the source of all examples is linked for easy reference. In order to run each example, you will need Zope Interface, Twisted, and Nevow installed, and then you will need to run the example server.
Under windows: you need to run the Twisted Shell from Start-->Applications-->Twisted menu. Under a unix like operating system, make sure that the twistd binary is on your PATH. Installing Twisted will do this for you.
To run the example server, go to the Nevow examples directory (eg: C:\Nevow\examples or /usr/src/Nevow/examples) and run the following command:
twistd -noy examples.tac
Then, to view the running examples, point your web browser at: http://localhost:8080/
Once you are viewing this page as served by the example server, all of the "live" links below will work.
Table of Contents
Test Suite
Nevow 0.4 now includes a live test runner which operates inside of your web browser. The test runner currently operates only under Firefox, and not IE or Safari. This will be fixed in a future release. Test suites for some of the examples provided here have been written. The following test suites may be executed by visiting their respective pages:
Examples Listing
-
A Nevow example that doesn't use any of Nevow automations
Stan Source most_basic.py -
Hello world in Nevow
Stan Source hellostan.py xmlfile Source hellohtml.py xmlfile Template hellohtml.html - How to get Session and Request objects from the context
Stan Source simple.py xmlfile Source simplehtml.py xmlfile Template simplehtml.html
-
Render tables in Nevow
xmlfile Source tablehtml.py xmlfile Template tablehtml.html - How to use xmlfile directives
Stan Source disktemplates_stan.py xmlfile Source disktemplates.py xmlfile Template disktemplates.html - How to handles page children with Nevow, and how to use the <nevow:attr> tag
Stan Source children.py xmlfile Source childrenhtml.py xmlfile Templates childrenhtml_RootPage.html
childrenhtml_ChildPage.html
childrenhtml_ChildOfChildPage.html - Allow data= directives to look inside application objects
Stan Source objcontainer.py - Manual form example
Stan Source manualform.py - Advanced manual form example
Stan Source advanced_manualform.py - Formless example
Stan Source formpost.py - Another formless example, but a little bit more complex
Stan Source formpost2.py - Example of interacting with a database
- An example of using HTTP Basic Auth for simple authentication
Stan Source http_auth.py - Various examples of how to integrate twisted.guard with Nevow for authentication
- Examples of how to access the session when a user logs out of guarded sites
- Use Configurables to render a form with Formless in a customized template
xmlfile Source customform.py - Dynamically build your forms
Stan Source formbuilder.py - Adapting an object to the IRenderer interface in order to make it render itself
Stan Source simple_irenderer.py - More complex example of adapting objects to IRenderer and to different interfaces
Stan Source irenderer.py - Handling and building a Tree structure dynamically on yor site
- Simple example of text localisation
- Localisation of disk templates
xmlfile Source hello.html Python Source xmli18n.py
LivePage/Canvas/XUL
-
Chatola: A multiuser realtime chat application using LivePage
Python Source chatola.py -
LiveAnimal: A small LivePage game
Python Source liveanimal.py - Integration between Flash(TM) and Nevow
-
Integration between XUL and Nevow
Stan Source xul_nevow.py XUL Source xul_example.xul
Tag Library Examples
- How to use the Calendar tag from the taglibrary
- How to use the TabbedPane tag from the taglibrary
- How to use the Progressbar tag from the taglibrary
Stan Source progress.py
Demo Applications
- Extremely basic library, made with atop
xmlfile Source: with_atop
- Handling users in a web site
Stan Source: userdb
- Liveevil example in a live chat page
Source: chatola
- Pastebin example with nevow
Source: pastebin
- Blog engine
Source: blogengine
- Link storage webservice (uses Twisted's XML-RPC)
Source: postit
- Todo list with rails like file structure (requires pgasync 1.3b and postgres)
Source: todo
- Image uploader that uses atop
Source: imagination