Created
June 10, 2010 06:59
-
-
Save inklesspen/432656 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class rewrite(object): | |
| def __init__(self, real_app): | |
| self.real_app = real_app | |
| def __call__(self, environ, start_response): | |
| if environ.get('PATH_INFO', '') == 'old_url': | |
| environ['PATH_INFO'] = 'new_url' | |
| return self.real_app(environ, start_response) | |
| from myapp import wsgi_app | |
| from myserver import serve | |
| serve(rewrite(wsgi_app)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment