Skip to main content

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

  1. Add 'icswebtracker' to your INSTALLED_APPS:
INSTALLED_APPS = [
    # ...
    'icswebtracker',
]
  1. Add the middleware:
MIDDLEWARE = [
    # ...
    'icswebtracker.middleware.TrackMiddleware',
]
  1. Run migrations:
python manage.py migrate icswebtracker
  1. 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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

icswebtracker-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

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

Hashes for icswebtracker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a2d591339f057c793792f6ac0ea02ac6b2b4b17025cd7cda8c9f0b1b94985612
MD5 cd9fb3a489fa33d0eb339ed9435ab229
BLAKE2b-256 0ef7a2166c55bfae2545f7352e1c3b702af0f669ff135d23748f09f2c5929f30

See more details on using hashes here.

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

Hashes for icswebtracker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b183c91e94cbc537ed093b83623fc4a0c266f77828ef7818f59eea8dca65b2c1
MD5 82e6ffb57f07c55255b2814dabfdc9f8
BLAKE2b-256 28360a0c987f31cd22b3cfd5d0120b3bbf7e0317ec017f5db7f2a234782bfcbb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page