Routes:用Python重新实现Rails的URL映射控制

fmms 8年前

Routes is a Python re-implementation of the Rails routes system for mapping URLs to application actions, and conversely to generate URLs. Routes makes it easy to create pretty and concise URLs that are RESTful with little effort.

Routes allows conditional matching based on domain, cookies, HTTP method, or a custom function. Sub-domain support is built in. Routes comes with an extensive unit test suite.

Current features:

  • Sophisticated route lookup and URL generation
  • Named routes
  • Redirect routes
  • Wildcard paths before and after static parts
  • Sub-domain support built-in
  • Conditional matching based on domain, cookies, HTTP method (RESTful), and more
  • Easily extensible utilizing custom condition functions and route generation functions
  • Extensive unit tests

项目主页:http://www.open-open.com/lib/view/home/1333595697014