Metadata-Version: 2.1
Name: django-user-visit
Version: 2.0
Summary: Django app used to track user visits.
Home-page: https://github.com/yunojuno/django-user-visit
License: MIT
Author: YunoJuno
Author-email: code@yunojuno.com
Maintainer: YunoJuno
Maintainer-email: code@yunojuno.com
Requires-Python: >=3.8,<4.0
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 3.2
Classifier: Framework :: Django :: 4.0
Classifier: Framework :: Django :: 4.1
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: django (>=3.2,<6.0)
Requires-Dist: user-agents (>=2.1,<3.0)
Project-URL: Documentation, https://github.com/yunojuno/django-user-visit
Project-URL: Repository, https://github.com/yunojuno/django-user-visit
Description-Content-Type: text/markdown

# django-user-visit

Django app for recording daily user visits

#### Compatibility

This package supports Python 3.8 and above and Django 3.2 and above.

## Upgrading from v1 to v2

v2 added three new denormalised fields extracted from the User Agent
string - device, os, browser - to make it easier to analyse directly
in the database.

If you want to backfill historical data you will need to run the
management command `update_user_visit_user_agent_data` after the
upgrade.

---

This app consists of middleware to record user visits, and a single
`UserVisit` model to capture that data.

The principal behind this is _not_ to record every single request made
by a user. It is to record each daily visit to a site.

The one additional factor is that it will record a single daily visit
per session / device / ip combination. This means that if a user visits
a site multiple times from the same location / same device, without
logging out, then they will be recorded once. If the same user logs in
from a different device, IP address, then they will be recorded again.

The goal is to record unique daily visits per user 'context' ( where
context is the location / device combo).

Admin list view:

![UserVisit list view](assets/screenshot-admin-list-view.png)

Admin edit view:

![UserVisit edit view](assets/screenshot-admin-edit-view.png)

