Skip to main content

dogpile support for cherrypy.

Installation

pip install marbaloo_dogpile

Usage

# app.py
import cherrypy
import marbaloo_dogpile
import os

marbaloo_dogpile.Plugin(cherrypy.engine).subscribe()
cherrypy.tools.dogpile = marbaloo_dogpile.Tool()


class Root(object):

    @cherrypy.expose
    def index(self):
        dogpile = cherrypy.request.dogpile
        counter = dogpile.get('counter')
        counter = 0 if isinstance(counter, int) is False else counter
        dogpile.set('counter', counter + 1)
        return str(counter)

root_path = os.path.dirname(__file__)
dogpile_dbm_path = os.path.join(root_path, 'dogpile.dbm')
config = {
    'global': {
        'marbaloo_dogpile': {
            'backend': 'dogpile.cache.dbm',
            'expiration_time': 3600,
            'arguments': {'filename': dogpile_dbm_path},
        }
    },
    '/': {
        'tools.dogpile.on': True
    }
}
cherrypy.quickstart(Root(), '/', config)

Metadata

Release files for marbaloo_dogpile 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for marbaloo_dogpile 0.1.0
File Size Uploaded
marbaloo_dogpile-0.1.0.tar.gz 2.5 kB Details

Release files / marbaloo_dogpile-0.1.0.tar.gz

Download URL marbaloo_dogpile-0.1.0.tar.gz
Size 2.5 kB
Tags Source
SHA-256 checksum
How to use checksums
10e39065a1c37be0bf7f0cb146888557e68a62cef499f2aed7e264651384d512
BLAKE2b-256 checksum
How to use checksums
114dfbc1c66189795182b965e84e72281b9670cf5fdb12ccc01ad225dfb56f81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page