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
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
Hashes for django_simple_analytics-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a6fdf70bcf8759c027055faf3b1e3179ad51aa1acf46726eacf87fec34f36b8 |
|
MD5 | d3650bb48ff64590defe7f8d8802e5b6 |
|
BLAKE2b-256 | e2d7edb715c29f5ef33c2bdda097c3c3e97ed5bff7a8a4eca04035c70f7efbd8 |