urlrelay 0.7.1
RESTful WSGI URL dispatcher.
Simple URL dispatcher that passes HTTP
requests to a WSGI application based on a matching URL path regex
pattern and an optional HTTP request method.
Usage example:
#!/bin/env python
import urlrelay
# Simple URL to application mapping
@urlrelay.url('^/$')
def index(environ, start_response):
start_response('200 OK', [('Content-type', 'text/plain')])
return ['Home Page']
# "RESTful" URL to application mapping
@urlrelay.url('^/hello_world$', 'GET')
def hello_world(environ, start_response):
start_response('200 OK', [('Content-type', 'text/plain')])
return ['Hello World']
# URL to on-disk application mapping
urlrelay.register('^/ondisk$', 'module.on_disk')
if __name__ == '__main__':
from wsgiref.simple_server import make_server
http = make_server('', 8080, urlrelay.URLRelay())
http.serve_forever()
| File | Type | Py Version | Uploaded on | Size | # downloads |
|---|---|---|---|---|---|
| urlrelay-0.7.1-py2.5.egg (md5) | Python Egg | 2.5 | 2009-01-15 | 24KB | 826 |
| urlrelay-0.7.1.tar.bz2 (md5) | Source | 2009-01-15 | 10KB | 2258 | |
| urlrelay-0.7.1.tar.gz (md5) | Source | 2009-01-15 | 10KB | 2878 | |
| urlrelay-0.7.1.win32.exe (md5) | MS Windows installer | any | 2009-01-15 | 73KB | 220 |
| urlrelay-0.7.1.zip (md5) | Source | 2009-01-15 | 14KB | 2610 | |
- Author: L. C. Rees
- Keywords: WSGI URL dispatch relay route middleware web HTTP
- License: BSD
-
Categories
- Development Status :: 4 - Beta
- Environment :: Web Environment
- License :: OSI Approved :: BSD License
- Natural Language :: English
- Operating System :: OS Independent
- Programming Language :: Python
- Topic :: Internet :: WWW/HTTP :: Dynamic Content
- Topic :: Internet :: WWW/HTTP :: Site Management
- Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware
- Package Index Owner: lcrees
- DOAP record: urlrelay-0.7.1.xml
