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.
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file django_simple_analytics-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: django_simple_analytics-0.4.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa8a68a7796f22c125248eecb89eabd51f1eba1d864879bd8eb6c5fb7e066029 |
|
MD5 | aef7a0f41f9bc7fceb7730223587ce0e |
|
BLAKE2b-256 | 94d6b16ea56c07a833e95d3086c1849742f41d28ad25e36b189dc10c5c36688f |