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

The tests pass using Python2.6 and Python3.2, e.g.:

$ nosetests --with-coverage --with-doctest --cover-package pyramid_weblayer pyramid_weblayer
............................
Name Stmts Miss Cover Missing
--------------------------------------------------------
pyramid_weblayer 15 0 100%
pyramid_weblayer.csrf 26 0 100%
pyramid_weblayer.hsts 35 0 100%
pyramid_weblayer.i18n 12 0 100%
pyramid_weblayer.seen 10 0 100%
pyramid_weblayer.session 12 0 100%
pyramid_weblayer.tx 33 0 100%
pyramid_weblayer.utils 37 0 100%
--------------------------------------------------------
TOTAL 180 0 100%
----------------------------------------------------------------------
Ran 28 tests in 0.430s

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

Uploaded Source

File details

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

File metadata

File hashes

Hashes for pyramid_weblayer-0.9.tar.gz
Algorithm Hash digest
SHA256 97c1a60c1b6223763a608c80b0f98042cfb706b5f0d95d518f3cdd14f302675d
MD5 0ca39ca7e189b60c5f2f2761158c1d26
BLAKE2b-256 97c8a7b2a3694570e7d444b3cea594fda0d8c4f59a83de1faa8e10512f9bf41e

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