Skip to main content

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.

Project details


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.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distributions

pyramid_rewrite-0.2-py3.2.egg (4.3 kB view details)

Uploaded Source

pyramid_rewrite-0.2-py2.7.egg (6.4 kB view details)

Uploaded Source

pyramid_rewrite-0.2-py2.6.egg (6.4 kB view details)

Uploaded Source

File details

Details for the file pyramid_rewrite-0.2.tar.gz.

File metadata

File hashes

Hashes for pyramid_rewrite-0.2.tar.gz
Algorithm Hash digest
SHA256 9ed1dc59d3264ae348d06daf29cf08a4ff9a76275117b7e61957e3af540f6b9c
MD5 ceff4eee33fe9ab6540d9ebddfe1e190
BLAKE2b-256 4f3e526da98e3673fcb20e7a4a41f3ce1e1bbe72feba5249511baf35eb1db8aa

See more details on using hashes here.

File details

Details for the file pyramid_rewrite-0.2-py3.2.egg.

File metadata

File hashes

Hashes for pyramid_rewrite-0.2-py3.2.egg
Algorithm Hash digest
SHA256 4c31dbf5d0af766cef7310c440c64438c78f8629829ec85daba05965e68c7201
MD5 9fc22f7dc7766b20e595d8cd82663883
BLAKE2b-256 860e9386585e86a85349430400d62bafbfa4f3c8ab8b6da1dfa433a04cd8865c

See more details on using hashes here.

File details

Details for the file pyramid_rewrite-0.2-py2.7.egg.

File metadata

File hashes

Hashes for pyramid_rewrite-0.2-py2.7.egg
Algorithm Hash digest
SHA256 930c9ced0adf45c485ceb212968437f50f2c99c35bf6957831683c0f40750197
MD5 ab3a829436f535c680e92865f3884ff1
BLAKE2b-256 0db6d3871fbeec5f68a4709892e785e7fd51eec4a0362f6dd6cf5ef64330f6f8

See more details on using hashes here.

File details

Details for the file pyramid_rewrite-0.2-py2.6.egg.

File metadata

File hashes

Hashes for pyramid_rewrite-0.2-py2.6.egg
Algorithm Hash digest
SHA256 1bb95f4fe0219be5604ada4f1e45f74dde98285a9ac10d11795f686ca07ba7ff
MD5 57a822770a31143f8e3cb790ee88e26e
BLAKE2b-256 08f06db37699b4b1a416af09e1cb296fcbf40a357466a03acd4f47946ff758d4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page