Skip to main content

URL routing made right

Project description

Just a small example:

from routr import route, GET, POST
from routr.schema import form, String

routes = route("/users",
  route(POST, "/",          "views.create_user", guards=[form(username=String)]),
  route(GET,  "/{id:int}",  "views.get_user"))

Docs are hosted at excellent readthedocs project.

0.1.5 (unreleased)

  • introduced RequestParams.exception_factory which abstracts away HTTPBadRequest raise in case of invalid data being supplied

0.1.4

  • RequestParams.post_processor now also can be accumulated via addition

  • fix bug in RequestParams which prevented Option wrap SchemaNode objects directly

0.1.3

  • fix broken 0.1.2 release by including CHANGES file in dist

0.1.2

  • trace factory made configurable via Configuration.trace attribute

  • method and PATH_INFO extraction delegated to configuration, allows implementing routing for other request wrapper (werkzeug or django’s request for example)

  • routes now have access to configuration object via cfg attribute

0.1.1

  • allow guards return None (routing doesn’t break on this and proceed with old trace)

  • RequestParams now can accept colander.SchemaNode directly (allows to supply validators)

0.1

  • initial release

Project details


Download files

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

Source Distribution

routr-0.1.4.tar.gz (12.2 kB view details)

Uploaded Source

File details

Details for the file routr-0.1.4.tar.gz.

File metadata

  • Download URL: routr-0.1.4.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for routr-0.1.4.tar.gz
Algorithm Hash digest
SHA256 29220fbb6ccf31dd769003906e5f2d841d5b315708441396447200c5e12fdef7
MD5 db35bf28cba612f699dbd59a28363991
BLAKE2b-256 e7252067729aeeed45be0a171fd281139a4bd116508e5155dd74f30253bbaffd

See more details on using hashes here.

Provenance

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