Django Audit Logger
django-audit-logger is a reusable Django app that automatically audits model changes (create, update, delete) across all models in your Django project. It integrates with Kafka for log streaming and allows flexible configuration auditing for important models. The app captures useful metadata such as the user who made the changes, request IP, URL, and more.
Features
- Automatic Auditing: Automatically register all Django models for audit logging after migrations.
- Kafka Integration: Uses
confluent_kafkato send audit logs to Kafka topics. - Configuration Auditing: Manually register important models for configuration auditing.
- User Context Middleware: Captures information about the user, request IP, and user agent via middleware.
- Customizable: You can extend or override middleware, and control the Kafka producer behavior.
Installation
-
INSTALL the package using pip:
pip install django-audit-kafkalogger
-
Add it to your Django INSTALLED_APPS:
In your
settings.py, configure the apps:INSTALLED_APPS = [ # Other installed apps 'audit_logger', ]
-
Add the MIDDLEWARE:
In your
settings.py, configure the middlewares:MIDDLEWARE = [ # Other middlewares 'audit_logger.middlewares.AuditUserMiddleware', ]
-
Add KAFKA CONFIGURATION:
In your
settings.py, configure the Kafka broker and topics:KAFKA_BROKER_URL = 'localhost:9092' # Replace with your Kafka broker URL KAFKA_TOPIC_LOGS = 'audit_logs' # Topic for log auditing KAFKA_TOPIC_ERRORS = 'audit_errors' # Topic for error logging KAFKA_TOPIC_CONFIG = 'audit_config' # Topic for configuration auditing
Metadata
Release files for django-audit-kafkalogger 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_audit_kafkalogger-0.2.tar.gz | 6.1 kB | Without provenance | Details for django_audit_kafkalogger-0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_audit_kafkalogger-0.2-py3-none-any.whl | Python 3 | none | any | Details for django_audit_kafkalogger-0.2-py3-none-any.whl |
Total release size: 13.1 kB
Release files / django_audit_kafkalogger-0.2.tar.gz
| Download URL | django_audit_kafkalogger-0.2.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
520cbb0d5ed77fe928de597944cd238a75dfa37be699e290fef0c108857cfcdb
|
|
BLAKE2b-256 checksum How to use checksums |
25871ef77421685a9dac91272d641da8dc26ff05737a45b4a4e9d238ba55b7e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.10
|
Release files / django_audit_kafkalogger-0.2-py3-none-any.whl
| Download URL | django_audit_kafkalogger-0.2-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3442f3b14ae426d4f30e2bd65f1b5b1322c32ab5bae0cb9269c2f8254277183
|
|
BLAKE2b-256 checksum How to use checksums |
7de5e163a88975a7edbf7651ae1062ba6fb1192c8a80f28c00442134c421ab9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.10
|
Security for django-audit-kafkalogger 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.