Skip to main content

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


Download files

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

Source Distribution

pyramid_weblayer-0.10.tar.gz (24.4 kB view details)

Uploaded Source

File details

Details for the file pyramid_weblayer-0.10.tar.gz.

File metadata

File hashes

Hashes for pyramid_weblayer-0.10.tar.gz
Algorithm Hash digest
SHA256 b6e01ee281f8d4dc0f56a4223bddc77ed1d62ee3e1a9798cd73ba30e82540f0c
MD5 d2919c708a782b6d25ca38dac57480ac
BLAKE2b-256 4f9961aa4aab2a775f748177e2483fe2385118eed9497047b03376f584e1b39e

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