Skip to main content

Add is_live to your Pyramid requests

Project description

https://travis-ci.com/GoodRx/pyramid-is-live.svg

pyramid-is-live uses a tween to add an is_live property to Pyramid requests, which is True if the request came from a HTTP interaction and False otherwise, e.g. if the request came from pyramid.paster.bootstrap.

Getting Started

  1. Install this package:

    pip install pyramid-is-live
  2. Include it in your application startup:

    def main(global_config, **settings):
        config = Configurator(...)
        config.include("pyramid_is_live")
        ...
  3. Use request.is_live in your views and scripts!

Contributing

We use tox to run our tests and linters.

Run tox to run all tests and linters.

Run tox -e format to reformat your code using Black and isort.

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-is-live-0.1.0.post4.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

pyramid_is_live-0.1.0.post4-py2.py3-none-any.whl (2.4 kB view hashes)

Uploaded Python 2 Python 3

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