Skip to main content

A simple django packages to track requests on the site

Project description

Django Simple Analytics

⚠️ This package is still in beta. Do not use for production ⚠️

Simple analytics is a very simple package to track requests done to the website and store them in database.

Installation

From PYPi using pip:

pip install django-simple-analytics

Usage

In order to install the package add the following line to INSTALLED_APPS

INSTALLED_APPS = [
    ...
    "simple_analytics",
]

This will make the model available for you to call and query. To enable the middleware, add this at the bottom of the middleware list:

MIDDLEWARE = [
    ...
    "simple_analytics.middleware.page_counts",
]

Then, you need to run migrations, finally:

./manage.py migrate

To actually create the table in the database.

Now every request done to the django website will be recorded in the database with the following fields:

  • Date: The date pf the request.
  • Page: The path of the request.
  • Method: The verb used to request the page.
  • Whether the page exists or not.
  • User: The user who performed the request. If the user is not authenticated, it will show as AnonymousUser.
  • view_count: The number of requests to that page, per date and per method used.

Licence

This package is distributed under MIT Licence.

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

django-simple-analytics-0.1.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

django_simple_analytics-0.1.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file django-simple-analytics-0.1.2.tar.gz.

File metadata

File hashes

Hashes for django-simple-analytics-0.1.2.tar.gz
Algorithm Hash digest
SHA256 fb03250adffd93b6a21b2bfad61fd81f9ffd9ce64eae97c8fa3fc47f01957203
MD5 c02d0070cea1c24d2e624df4f20f1ca3
BLAKE2b-256 e3a917e6b88db7c7711291b1b86de9eb77fda7144565ecb2bf249ab9f31d6a83

See more details on using hashes here.

File details

Details for the file django_simple_analytics-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_simple_analytics-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1435e607b3a5c50d742eafccb24169e8379bd666312d668cc4bda85b75562cbb
MD5 f89daac37fdc0bce4dc2324a8e34fbc7
BLAKE2b-256 afb32fd13ea46cc9e8f079df455a304f18542bd3be433c75fee282ee8ac2637c

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