Skip to main content

Django Audit is a simple Django app that tracks and logs requests to your application.

Project description

django-audit

GitHub issues PyPI - Downloads Codecov pre-commit

Django Audit is a simple Django app that tracks and logs requests to your application.

Quick Start

  1. Install django-audit
pip install dj-audit
  1. Add dj_audit to your INSTALLED_APPS:
INSTALLED_APPS = [
    ...,
    "dj_audit"
]
  1. Add dj_audit middleware:
MIDDLEWARE = [
    ...
    "dj_audit.middleware.AuditMiddleware"
]

if you want access to the dj-audit dashboard, then add the following to your urls.py

urlpatterns = [
    path("admin/", admin.site.urls),
    path("dj-audit/", include('dj_audit.urls'))
]
  1. Run migrate
python manage.py migrate

Management commands

flush_auditlog - Cleans up dj-audit AuditLog table

python manage.py flush_auditlog

Customizing dj-audit

You have a couple options available to you to customize dj-audit a bit. These should be defined in your settings.py file.

  • DISABLE_AUDIT_LOG: bool: Disable or Enable dj_audit
  • AUDIT_LOG_TEMPLATE: str: If set, the template here will be render when the user visits the audit log page (i.e /dj-audit/audit-logs/)
  • REQUEST_STATUS_TEMPLATE: str: If set, the template here will be render when the user visits the request status page (i.e /dj-audit/request-status/)
  • API_BASE_URL: str: Base url for API requests if any

Test

make test

or with coverage

make coverage_test

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

dj_audit-0.0.9.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

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

dj_audit-0.0.9-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

File details

Details for the file dj_audit-0.0.9.tar.gz.

File metadata

  • Download URL: dj_audit-0.0.9.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for dj_audit-0.0.9.tar.gz
Algorithm Hash digest
SHA256 eea284187b4b45437eac74294a19f9027beb66a09de482615b0438807edf81f8
MD5 223507c2ea10cad2ffce629defb86c2a
BLAKE2b-256 20694ca3ed2eae90381fd3855162ac78cb6e6e13145c34efbce2fc96baa8032c

See more details on using hashes here.

File details

Details for the file dj_audit-0.0.9-py3-none-any.whl.

File metadata

  • Download URL: dj_audit-0.0.9-py3-none-any.whl
  • Upload date:
  • Size: 20.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for dj_audit-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9a54bf958c349fc980f95a267e0e88a4ddf574ff64183d15aa05bb17e3053ec8
MD5 a3c0aaf411deedfd5133e62a20946277
BLAKE2b-256 0f04a03c566ba2b332f66c069231e106ae1ce6778588455bf98b7f556ac8d10d

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