Skip to main content

Simple RESTful WSGI URL dispatcher.

Project description

Simple URL dispatcher that passes HTTP requests to a WSGI application based on a matching regular expression and an optional HTTP request method.

Usage example:

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()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

urlrelay-0.7.1.zip (15.0 kB view details)

Uploaded Source

urlrelay-0.7.1.tar.gz (10.4 kB view details)

Uploaded Source

urlrelay-0.7.1.tar.bz2 (10.5 kB view details)

Uploaded Source

Built Distributions

urlrelay-0.7.1.win32.exe (74.9 kB view details)

Uploaded Source

urlrelay-0.7.1-py2.5.egg (24.8 kB view details)

Uploaded Source

File details

Details for the file urlrelay-0.7.1.zip.

File metadata

  • Download URL: urlrelay-0.7.1.zip
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for urlrelay-0.7.1.zip
Algorithm Hash digest
SHA256 50b816789963c2850a4f6f3c07f811f07db7c9e9f47ec0ee3e0ac0257599a937
MD5 7c365e2ea44bb32e30f26a2b3a4b78a0
BLAKE2b-256 03dc37666b179975601fbbe48412f1aaba3a7b23c963edd7de9b30fa0ffbdf64

See more details on using hashes here.

File details

Details for the file urlrelay-0.7.1.tar.gz.

File metadata

  • Download URL: urlrelay-0.7.1.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for urlrelay-0.7.1.tar.gz
Algorithm Hash digest
SHA256 3cb61b471075ecfc77b6e8b3a6eae93d3b9156de2e7cd339fb968a56c3807802
MD5 245b3a66cb2691ffb2e8662b7944212f
BLAKE2b-256 a01b05f82f0a1a58d7e923601f4fdb8513af400bfe2db568886a1fabb470b8d6

See more details on using hashes here.

File details

Details for the file urlrelay-0.7.1.tar.bz2.

File metadata

  • Download URL: urlrelay-0.7.1.tar.bz2
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for urlrelay-0.7.1.tar.bz2
Algorithm Hash digest
SHA256 4344348075f856e43924dc8608945b829c0d8f033e85b27fa0f25dbfb561ed89
MD5 43dd0a468eb511463b37051a0adcd1bc
BLAKE2b-256 84ca5b92a491a7a13214da4982504bf6102dcda4ed3e0547ca6e697cc6269d93

See more details on using hashes here.

File details

Details for the file urlrelay-0.7.1.win32.exe.

File metadata

  • Download URL: urlrelay-0.7.1.win32.exe
  • Upload date:
  • Size: 74.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for urlrelay-0.7.1.win32.exe
Algorithm Hash digest
SHA256 7e5c047aa5037ab02b35929cd3d08f328c9a4f498884abe9095a21fddadf7788
MD5 44dff3b694e1fa19959b1de619f93a89
BLAKE2b-256 7a03263f5e6e97998363fcf16b047b89732df1af3866d14d86c8d7bd67f82647

See more details on using hashes here.

File details

Details for the file urlrelay-0.7.1-py2.5.egg.

File metadata

  • Download URL: urlrelay-0.7.1-py2.5.egg
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for urlrelay-0.7.1-py2.5.egg
Algorithm Hash digest
SHA256 a5cfd38e65ec925f7eca4b29768c66bf8eaed1c94cdbc025d670f0d0e8f08bbc
MD5 7f9f4dea5f9e7bf76c14a44c3726eba2
BLAKE2b-256 59ba7650679dcdb512ebe0bfec7fa53938ac6fc7fb9775e39d828e34e38adcdb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page