Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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

Compatibility

pyramid_rewrite runs with pyramid>=1.3 and python>=2.6 and python>=3.2. Other versions might also work.

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 might follow.

Changes

0.2

  • Added unit tests
  • Changed logging level

0.1

  • Initial version. Working.
Release History

Release History

This version
History Node

0.2

History Node

0.1

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyramid_rewrite-0.2-py2.6.egg (6.4 kB) Copy SHA256 Checksum SHA256 2.6 Egg Feb 5, 2012
pyramid_rewrite-0.2-py2.7.egg (6.4 kB) Copy SHA256 Checksum SHA256 2.7 Egg Feb 5, 2012
pyramid_rewrite-0.2-py3.2.egg (4.3 kB) Copy SHA256 Checksum SHA256 3.2 Egg Feb 5, 2012
pyramid_rewrite-0.2.tar.gz (4.1 kB) Copy SHA256 Checksum SHA256 Source Feb 5, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting