Skip to main content

Simple logging of user access to URLs in Django.

Project description

django-view-tracking

Simple logging of user access to URLs in Django.

Usage

Install:

pip install django-view-tracking

Enable:

# settings.py

INSTALLED_APPS = [
    ...
    'django_view_tracking',
    ...
]

MIDDLEWARE = [
    ...
    'django_view_tracking.middleware.ViewTrackingMiddleware',
    ...
]

Configure:

# global kill switch
DJANGO_VIEW_TRACKING_ENABLED = True

# switch logging for anonymous users on or off
DJANGO_VIEW_TRACKING_ANONYMOUS_USER = True

# ignore logging for specific paths
DJANGO_VIEW_TRACKING_BLACKLIST = [
    reverse('admin:index'),
]

Migrate:

python manage.py migrate

Enjoy:

View logs in the Django Admin under Django View Tracking.

License

MIT License

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

django-view-tracking-0.2.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

django_view_tracking-0.2-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

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