A Django app for tracking website visitors
Project description
ICSwebtracker
A simple, lightweight Django app for tracking website visitors without JavaScript.
Features
- Track page visits with IP address, user agent, and other metadata
- Configurable exclusion rules for paths and IP addresses
- Easy-to-use admin interface for viewing visitor data
- Works with Django's built-in authentication system
- Optimized for low-traffic sites (less than 1,000 visitors per month)
- No JavaScript required - works server-side with Django middleware
Installation
pip install icswebtracker
Quick Start
- Add 'icswebtracker' to your INSTALLED_APPS:
INSTALLED_APPS = [
# ...
'icswebtracker',
]
- Add the middleware:
MIDDLEWARE = [
# ...
'icswebtracker.middleware.TrackMiddleware',
]
- Run migrations:
python manage.py migrate icswebtracker
- Configure settings (optional):
WEBTRACKER_SETTINGS = {
'ENABLED': True,
'IGNORE_PATHS': ['/admin/', '/static/', '/media/'],
'IGNORE_IPS': ['127.0.0.1'],
'TRACK_AUTHENTICATED': True,
'TRACK_ANONYMOUS': True,
'RESOLVE_COUNTRY': False,
}
Usage
Visit data is available in the Django admin interface. You can also query the data programmatically:
from icswebtracker.models import Visit
# Get all visits
all_visits = Visit.objects.all()
# Get visits to a specific page
page_visits = Visit.objects.filter(path='/some/page/')
# Get visits from a specific country
country_visits = Visit.objects.filter(country='US')
Configuration Options
ENABLED: Enable or disable tracking (default: True)IGNORE_PATHS: Paths to exclude from tracking (default: ['/admin/', '/static/', '/media/'])IGNORE_IPS: IP addresses to exclude from tracking (default: [])TRACK_AUTHENTICATED: Whether to track authenticated users (default: True)TRACK_ANONYMOUS: Whether to track anonymous users (default: True)RESOLVE_COUNTRY: Enable IP to country resolution (default: False, requires GeoIP2)
License
MIT
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 Distribution
icswebtracker-0.1.0.tar.gz
(5.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file icswebtracker-0.1.0.tar.gz.
File metadata
- Download URL: icswebtracker-0.1.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2d591339f057c793792f6ac0ea02ac6b2b4b17025cd7cda8c9f0b1b94985612
|
|
| MD5 |
cd9fb3a489fa33d0eb339ed9435ab229
|
|
| BLAKE2b-256 |
0ef7a2166c55bfae2545f7352e1c3b702af0f669ff135d23748f09f2c5929f30
|
File details
Details for the file icswebtracker-0.1.0-py3-none-any.whl.
File metadata
- Download URL: icswebtracker-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b183c91e94cbc537ed093b83623fc4a0c266f77828ef7818f59eea8dca65b2c1
|
|
| MD5 |
82e6ffb57f07c55255b2814dabfdc9f8
|
|
| BLAKE2b-256 |
28360a0c987f31cd22b3cfd5d0120b3bbf7e0317ec017f5db7f2a234782bfcbb
|