Simple audit logging for Django requests
Project description
This package adds simple audit logging to a Django project.
A log is generated at info level each time a request is made. The log includes the following information:
A UTC timestamp
Request method (HTTP verb)
Full URL
IP address
A value from a custom user field (see below)
The requesting user’s email address
The requesting user’s first name
The requesting user’s last name
Installation
pip install django-audit-log-middleware
Usage
Using in a Django middleware configuration:
INSTALLED_APPS = [
...
"django_audit_log_middleware",
]
MIDDLEWARE = [
...
"django_audit_log_middleware.AuditLogMiddleware",
]
Dependencies
This project is a Django app and depends on the Django package.
This package uses Django IPware https://github.com/un33k/django-ipware for IP address capture.
Settings
AUDIT_LOG_USER_FIELD
Provide to define a field on your user model that should be captured in the audit log. Email, first name and last name are captured by default.
Tests
$ pip install -r requirements.txt
$ tox
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
Hashes for django_audit_log_middleware-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e92b1b594db68720ac35edfecc21daaf8d1c446af00622ade4de14bcbc43329b |
|
MD5 | b5c1970510eadff0056a258bc3aa5bae |
|
BLAKE2b-256 | 179959ceb5f1fcf0a98f6752c85eeca71a1c0d9d2e095ded08aaf71377ceedc9 |