close Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 13 and Version 14 of UrlRouting


Ignore:
Timestamp:
Nov 8, 2009, 9:27:20 PM (15 years ago)
Author:
cmlenz
Comment:

Add info on rerouting

Legend:

Unmodified
Added
Removed
Modified
  • UrlRouting

    v13 v14  
    5858Finally, the `redirect_to(target, *args, **kwargs)` function is a shortcut for redirecting to the absolutized result of `path_to()`. It will raise an HTTP exception, and thus immediately break out of the current code.
    5959
     60=== Rerouting Generated URLs ===
     61
     62The routing can be configured to reroute certain routes to different URLs for URL generation. For example, you could set up a static resource directory to be rerouted to one or more different host name.
     63
     64{{{
     65#!python
     66app.routing.reroute('media',
     67    lambda filename=None: 'http://static.example.com/%s' % filename
     68)
     69}}}
     70
     71This only has effect on URL generation. If the route is setup to also handle incoming requests, they will still be matched and processed as before.
     72
    6073== Delegating to Other WSGI Applications ==
    6174