Skip to main content

A simple django packages to track requests on the site

Project description

Django Simple Analytics

PyPI PyPI - License PyPI - Python Version

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.
  • Origin: If the header exists in the requst, where the request originated.
  • 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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_simple_analytics-1.3.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_simple_analytics-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a24bfe0eb8e9691b03e6e112a900703c6f9c80afc6dd9b5c921a1e1ca0fe9b5
MD5 877fc885c5794053380525238e33f2ba
BLAKE2b-256 c610ff381e70497e3b63cbd8b319751b143a0638c4cf9c8a4977f9b72e92a69d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page