Skip to main content

A reusable app to track view hits

Project description

A reusable app to track view hits.


To get the latest stable release from PyPi

$ pip install django-traces

To get the latest commit from GitHub

$ pip install -e git+git://

Add traces to your INSTALLED_APPS


Add the traces URLs to your

urlpatterns = patterns('',
    url(r'^traces/', include('traces.urls')),

Don’t forget to migrate your database

./ migrate traces


If you want to track a certain view just add our middleware:


…and add the view name/url name to the setting TRACED_VIEWS. If you have added a view like this:

url(r'^$', TemplateView.as_view(template_name='test.html'), name='test_view'),

…your setting should look like:

TRACED_VIEWS = ['test_view', ]

The app will now track all visits to this view.

Template tags


To get the current amount of requests for this view:

{% load traces_tags %}
{% get_view_hits as hits %}
Hits: {{ hits }}

You can also provide the view name to get any view hits:

{% load traces_tags %}
{% get_view_hits 'view_name' as hits %}
Hits: {{ hits }}

{% get_view_hits 'model_view_name' object as model_view_hits %}
Hits: {{ model_view_hits }}



Default: []

List all view names to track.


If you want to contribute to this project, please perform the following steps

# Fork this repository
# Clone your fork
$ mkvirtualenv -p python2.7 django-traces
$ python install
$ pip install -r dev_requirements.txt

$ git co -b feature_branch master
# Implement your feature and tests
$ git add . && git commit
$ git push -u origin feature_branch
# Send us a pull request for your feature branch

Project details

Download files

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

Files for django-traces, version 0.4
Filename, size File type Python version Upload date Hashes
Filename, size django-traces-0.4.tar.gz (10.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page