Skip to content

Commit

Permalink
Merge pull request #1 from dreamhost/master
Browse files Browse the repository at this point in the history
Cleaned up README (looks good to me, thanks @oubiwann!)
  • Loading branch information
Zach Steindler committed May 29, 2012
2 parents 11ebcd7 + dfbf8f1 commit 708eee9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
18 changes: 15 additions & 3 deletions README → README.rst
@@ -1,14 +1,24 @@
Provides routes-like dispatching for twisted.web.server.
txroutes
========

txroutes provides routes-like dispatching for twisted.web.server (it actually
depends upon the Python routes codebase).

Frequently, it's much easier to describe your website layout using routes
instead of Resource from twisted.web.resource. This small library lets you
dispatch with routes in your twisted.web application.

Usage:
Usage
-----

Here is an example of how to use txroutes::

from twisted.internet import reactor, task
from twisted.web.server import Site, NOT_DONE_YET

from txroutes import Dispatcher


# Create a Controller
class Controller(object):

Expand Down Expand Up @@ -46,6 +56,8 @@ Usage:
reactor.listenTCP(8000, factory)
reactor.run()

Helpful background information:

Additional Information
----------------------
- Python routes: http://routes.groovie.org/
- Using twisted.web.resources: http://twistedmatrix.com/documents/current/web/howto/web-in-60/dynamic-dispatch.html
3 changes: 3 additions & 0 deletions txroutes/__init__.py
Expand Up @@ -15,6 +15,9 @@ class Dispatcher(Resource):
from twisted.internet import reactor, task
from twisted.web.server import Site, NOT_DONE_YET
from txroutes import Dispatcher
# Create a Controller
class Controller(object):
Expand Down

0 comments on commit 708eee9

Please sign in to comment.