Permalink
Browse files

Merge pull request #1 from dreamhost/master

Cleaned up README (looks good to me, thanks @oubiwann!)
  • Loading branch information...
2 parents 11ebcd7 + dfbf8f1 commit 708eee916e342db84df9eb396d987aa0121539d1 @steiza committed May 29, 2012
Showing with 18 additions and 3 deletions.
  1. +15 −3 README → README.rst
  2. +3 −0 txroutes/__init__.py
View
@@ -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):
@@ -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
@@ -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):

0 comments on commit 708eee9

Please sign in to comment.