Small pyramid extension for rewriting urls
Project description
Introduction
pyramid_rewrite is a small extension for pyramid to rewrite urls before further processing takes place.
Installation
Just do
pip install pyramid_rewrite
or
easy_install pyramid_rewrite
Documentation
Usage example:
def main(global_config, **settings): config = Configurator(settings=settings) config.include('pyramid_rewrite') # add url rewriting rules... # first parameter is a regular expression # second parameter is the target url config.add_rewrite_rule(r'/favicon.ico', r'/static/favicon.ico') config.add_rewrite_rule(r'/gallery/(?P<subpath>.*)', r'/root/%(subpath)s') # # ... rest of configuration # # return WSGI application instance return config.make_wsgi_app()
Better documentation will follow.
Changes
0.1
Initial version. Working.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyramid_rewrite-0.1.tar.gz
(3.2 kB
view hashes)
Built Distributions
pyramid_rewrite-0.1-py2.7.egg
(3.7 kB
view hashes)
pyramid_rewrite-0.1-py2.6.egg
(3.7 kB
view hashes)