Common / reusable utilities for a Pyramid web application.
Project description
Common / shared utilities for a [Pyramid][] web application. (Some originally re-factored from the depreciated [weblayer][] micro-framework).
I generally use this package as a home for simple bits of code that are reusable across Pyramid applications, i.e.: stuff I’ve written once for a project and then extracted for use across multiple projects.
Highlights include:
a subscriber to validate incoming requests against cross site request forgeries
a subscriber that extends the template namespace with a _() function for translating message strings
an hsts.force_https configuration flag to force incoming requests to https
a join_to_transaction function to hang function calls off an after commit hook
a whole bunch of other request properties and utility functions
Read the source for more info.
## Tests
I tend to add things too fast to keep 100% coverage and test against multiple Python versions. So expect code to be tested against python2.7 and to have decent but not exhaustive coverage. Patches to increase compatibility and coverage are very welcome.
To run the tests, pip install mock nose coverage WebTest and e.g.:
$ nosetests pyramid_weblayer –with-doctest –with-coverage –cover-tests –cover-package pyramid_weblayer … Ran 40 tests in 0.297s
OK
[pyramid]: http://pypi.python.org/pypi/pyramid [weblayer]: http://github.com/thruflo/weblayer
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
File details
Details for the file pyramid_weblayer-0.10.2.tar.gz
.
File metadata
- Download URL: pyramid_weblayer-0.10.2.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 892e4d9fa933fabe4531c3703f2dd2e1ac2ebfbd762b42d22591461994b477b5 |
|
MD5 | 4caf7262578d6639aab981b6a06b6007 |
|
BLAKE2b-256 | 4c8c49a54eb4a2cccc7131e7f16ce114b0e8f7fe84369d4a240a80e27cbbf157 |