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
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyramid_rewrite-0.2.tar.gz.
File metadata
- Download URL: pyramid_rewrite-0.2.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ed1dc59d3264ae348d06daf29cf08a4ff9a76275117b7e61957e3af540f6b9c
|
|
| MD5 |
ceff4eee33fe9ab6540d9ebddfe1e190
|
|
| BLAKE2b-256 |
4f3e526da98e3673fcb20e7a4a41f3ce1e1bbe72feba5249511baf35eb1db8aa
|
File details
Details for the file pyramid_rewrite-0.2-py3.2.egg.
File metadata
- Download URL: pyramid_rewrite-0.2-py3.2.egg
- Upload date:
- Size: 4.3 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c31dbf5d0af766cef7310c440c64438c78f8629829ec85daba05965e68c7201
|
|
| MD5 |
9fc22f7dc7766b20e595d8cd82663883
|
|
| BLAKE2b-256 |
860e9386585e86a85349430400d62bafbfa4f3c8ab8b6da1dfa433a04cd8865c
|
File details
Details for the file pyramid_rewrite-0.2-py2.7.egg.
File metadata
- Download URL: pyramid_rewrite-0.2-py2.7.egg
- Upload date:
- Size: 6.4 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
930c9ced0adf45c485ceb212968437f50f2c99c35bf6957831683c0f40750197
|
|
| MD5 |
ab3a829436f535c680e92865f3884ff1
|
|
| BLAKE2b-256 |
0db6d3871fbeec5f68a4709892e785e7fd51eec4a0362f6dd6cf5ef64330f6f8
|
File details
Details for the file pyramid_rewrite-0.2-py2.6.egg.
File metadata
- Download URL: pyramid_rewrite-0.2-py2.6.egg
- Upload date:
- Size: 6.4 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bb95f4fe0219be5604ada4f1e45f74dde98285a9ac10d11795f686ca07ba7ff
|
|
| MD5 |
57a822770a31143f8e3cb790ee88e26e
|
|
| BLAKE2b-256 |
08f06db37699b4b1a416af09e1cb296fcbf40a357466a03acd4f47946ff758d4
|