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

⚠️ 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.
  • 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

django_simple_analytics-0.3.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_simple_analytics-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.8.3 requests/2.28.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.7.13

File hashes

Hashes for django_simple_analytics-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e1ac499cfbb3381f7e5c38d2acdc8cd8ece602fddb158a2bbb0e6f1442db7ad7
MD5 3d981a6a49d3d12e60abda6fee339b1e
BLAKE2b-256 4ab13cf4158a23e177050372acdd2fb8d484f2a90255b230579f21ec0f012e17

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