Divmod : Nevow
Contents
Nevow - Pronounced as the French "nouveau", or "noo-voh", Nevow is a web application construction kit written in Python. It is designed to allow the programmer to express as much of the view logic as desired in Python, and includes a pure Python XML expression syntax named stan to facilitate this. However it also provides rich support for designer-edited templates, using a very small XML attribute language to provide bi-directional template manipulation capability.
Nevow also includes formless, a declarative syntax for specifying the types of method parameters and exposing these methods to the web. Forms can be rendered automatically, and form posts will be validated and input coerced, rendering error pages if appropriate. Once a form post has validated successfully, the method will be called with the coerced values.
Athena - Finally, Nevow includes Athena, a two-way bridge between Javascript in a browser and Python on the server. Athena is compatible with Mozilla, Firefox, Windows Internet Explorer 6, Opera 9 and Camino (Don't see your favorite browser?). Event handlers can be written in pure Python and Javascript implementation details are hidden from the programmer, with Nevow taking care of routing data to and from the server using XmlHttpRequest. Athena supports a widget authoring framework that simplifies the authoring and management of client side widgets that need to communicate with the server. Multiple widgets can be hosted on an Athena page without interfering with each other. Athena supports automatic event binding so that that a DHTML event (onclick,onkeypress,etc) is mapped to the appropriate javascript handler (which in turn may call the server).
Download
- Stable: Latest release - 0.9.33
- Trunk: svn co http://divmod.org/svn/Divmod/trunk/Nevow/ Nevow
Features
- XHTML templates: contain no programming logic, only nodes tagged with nevow attributes
- data/render methods: simplify the task of separating data from presentation and writing view logic
- stan: An s-expression-like syntax for expressing xml in pure python
- Athena: Cross-browser JavaScript library for sending client side events to the server and server side events to the client after the page has loaded, without causing the entire page to refresh
- formless: (take a look at formal for an alternate form library) For describing the types of objects which may be passed to methods of your classes, validating and coercing string input from either web or command-line sources, and calling your methods automatically once validation passes.
- webform: For rendering web forms based on formless type descriptions, accepting form posts and passing them to formless validators, and rendering error forms in the event validation fails
Documentation
Start here
- The Nevow guide: An introductory guide covering Nevow basics (Getting Started, Object Traversal, Object Publishing, XML Templates, Deploying Nevow Applications)
- ''Development'' version of the Nevow API docs
- Meet Stan: An excellent tutorial on the Nevow Document Object Model by Kieran Holland
- Nevow Tutorial: Part I, Part II, Part III, Part IV, Part V, Part VI
- Twisted Components: If you are unfamiliar with Interfaces and Adapters then Nevow may not make much sense. This is essential reading.
- Athena Documentation
FAQ
Form handling
- Form handling in Nevow
- Pollenation's Formal Project: A fresh take on automatic form generation for Nevow, with a simpler interface and more input types than Formless. This project was formerly known as "forms".
- JavaScript WYSIWYG Editors integration with Nevow/formal
Advanced
- Error handling in Nevow: How to create custom error (404 and 500) pages
- Tips for using Emacs + Nevow
- Deployment techniques
- Putting Nevow Page under Apache Proxy
- Bleeding Docs - SURGEON GENERAL’S WARNING: Reading the docs listed below pertain to code that has not yet been released and may cause Lung Cancer, Heart Disease, Emphysema, and Pregnancy complications. Context Removal - Conversion steps for moving from context-based Nevow code to context-less code.
3rd party
- Using Nevow with Genshi templates: original and dynamic
- Using the Storm ORM with Nevow
Examples
- To run the examples yourself (Source in trunk/Nevow/examples):
richard@lazar:/tmp$ cd Nevow/examples/ richard@lazar:/tmp/Nevow/examples$ twistd -noy examples.tac 2005/11/02 15:18 GMT [-] Log opened. 2005/11/02 15:18 GMT [-] twistd SVN-Trunk (/usr/bin/python 2.4.2) starting up 2005/11/02 15:18 GMT [-] reactor class: twisted.internet.selectreactor.SelectReactor 2005/11/02 15:18 GMT [-] Loading examples.tac... 2005/11/02 15:18 GMT [-] Loaded. 2005/11/02 15:18 GMT [-] nevow.appserver.NevowSite starting on 8080 2005/11/02 15:18 GMT [-] Starting factory <nevow.appserver.NevowSite instance at 0xb6c8110c>
...visit http://localhost:8080 and you'll begin to appreciate the possibilities!
Help / Support
You will find plenty of experts on the mailing lists and in the chatrooms who will happily help you, but please make sure you read all the documentation, study all the examples and search the mailing list archives first. The chances are that your question has already been answered.
- Mailing list: The twisted-web and divmod-dev mailing list pages have subscription instructions and links to the web based archives.
- IRC: Nevow developers and users can be found on Freenode in #twisted.web
- Blogs: dialtone, fzZzy, Tv
- Tickets (More tickets)
Related Projects
- Eocmanage: An alternative to Mailman built with Twisted and Nevow.
- Pollenation's Formal Project: A fresh take on automatic form generation for Nevow, with a simpler interface and more input types than Formless. This project was formerly known as "forms".
- Mantissa: An extensible, multi-protocol, multi-user, interactive application server built on top of Axiom and Nevow.
- Stiq: A web news system built using Nevow
- WubWubWub: "Making Twisted.Web look like Apache since 2002" A fully featured Twisted based webserver for serving multiple twisted.web and Nevow apps.

