Skip to main content
Django-Cached-HitCount
===============

Basic app that allows you to track the number of hits/views for a particular
object.

All hits are stored in memcache until persisted to database.

As the hits are stored in cache there are no DB queries/inserts/updates on each request.

Adding hits is done via an ajax call so that app can still be used on cached views.

You can persist the hits to DB using celery and the `persist_hits` periodic task or use the `persist_hits` management command.

python manage.py persist_hits

hitcount_example app shows how to use app, by using `get_hit_count_javascript_template` and `get_hit_count` template tags.

Available settings are:

* HITCOUNT_CACHE -The CACHES setting dict key to use for caching hits (default is `cached_hitcount`)
* HITCOUNT_CACHE_TIMEOUT - How long in seconds should the hits be cached for before persisted (default is `600`)
* HITCOUNT_IP_CACHE_TIMEOUT - How long in seconds should the black list ip addresses be cached for (default is `86400` seconds = 1 day)
* HITCOUNT_PERSIST_SCHEDULE - How often should the hits be persisted (default is `15` minutes)
* HITCOUNT_IP_CACHE - key name to use for caching the blacklist ip addresses (default is `hitcount__blacklistip`)
* HITCOUNT_EXCLUDE_IP_ADDRESS - Whether or not you want to exclude some ip addresses (default is True)
* HITCOUNT_EXCLUDE_BOTS - Whether or not you exclude bots (default is True)
* HITCOUNT_LOCK_KEY - key name to use for locking when persisting hits to DB
* HITCOUNT_CSRF_EXEMPT - Whether or not ajax view is CSRF exempt by default. Useful if the pages you are using hitcount on are cached. (default is False)
* HITCOUNT_SERVER_CALLBACKS - Dict with with value as tuple of module and method to call on server. (default is {})
* HITCOUNT_CLIENT_CALLBACKS - List of Javascript functions to call when response is received. Response is passed to these functions. (default is [])


Also a gargoyle switch `cached_hitcount` to switch on/off all hit counting (default is True)

This app was very much inspired by <http://damontimm.com/code/django-hitcount/>


Installation:
-------------

Simplest way to formally install is to run:

./setup.py install

Or, you could do a PIP installation:

pip install -e git://github.com/philroche/django-cached-hitcount.git#egg=django-cached-hitcount

Or using PyPi

pip install django-cached-hitcount

Copyright:
-------------

This package is © 2014 Philip Roche, released under the terms of the GNU GPL v3 (or at your option a later version).

Metadata

Release files for django-cached-hitcount 0.4

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

Source distribution (sdist)

Source distribution for django-cached-hitcount 0.4
File Size Uploaded Provenance Actions
django-cached-hitcount-0.4.tar.gz 13.9 kB Without provenance Details for django-cached-hitcount-0.4.tar.gz

Release files / django-cached-hitcount-0.4.tar.gz

Download URL django-cached-hitcount-0.4.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5649a31b10edcb5979b69edc391e3b06a146dc517a720f57a941509878a788da
BLAKE2b-256 checksum
How to use checksums
0cedcf94572a3f19c18e405d4062ed062f4c2d6c1d129ce20096d7c81df413ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-cached-hitcount 0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4 This release

1 release file No provenance

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