Skip to main content

Package for easy creation of audit logs in Django projects

Project description

Django Auditor Logs is a Django app that provides a simple way to log events CREATE, UPDATE AND DELETE in your Django project. It is designed to be used with the Graphene Django package or Django Graphbox, but can be used with any Django project.

Installation

pip install django-auditor-logs

Important

This package is not thread safe. It is designed to be used with a single thread. If you are using a multi-threaded server, you will need to use a thread-safe logging package.

Quick start

  1. Add “django_auditor_logs” to your INSTALLED_APPS setting like this::
    INSTALLED_APPS = [
        ...
        'django_auditor_logs',
    ]
  2. Configure AUDIT_APPS in your settings.py file like this::
    AUDIT_APPS = [
        'app1',
        'app2',
    ]
  3. Run python manage.py migrate to create the django_auditor_logs models.

  4. Optionally you can change MIGRATION_MODULES in your settings.py file like this::
    MIGRATION_MODULES = {
        'django_auditor_logs': 'app1.migrations',
    }
  5. User and request metadata is set by a middleware. Add the middleware to your MIDDLEWARE setting like this::
    MIDDLEWARE = [
        ...
        'django_auditor_logs.middleware.metadata_middleware.MetadataMiddleware',
    ]

Release notes

  • 1.0.0
    • Initial release.

  • 1.0.1
    • Replace decorator and __user_metadata__ and __request_metadata__ fields by a MetadataManager class used in a Middleware.

  • 1.0.2
    • Fix documentation of the middleware.

  • 1.0.3
    • Fix WARNING default_auto_field.

  • 2.0.0
    • Add optional interaction with django_graphbox to build a graphql schema with queries to read the logs.

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_auditor_logs-2.0.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

django_auditor_logs-2.0.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file django_auditor_logs-2.0.1.tar.gz.

File metadata

  • Download URL: django_auditor_logs-2.0.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for django_auditor_logs-2.0.1.tar.gz
Algorithm Hash digest
SHA256 850b04f89cdb5f189cda41ad019283be3076051f29266dbde7d7252b227f1e04
MD5 f2c711f3fefeaeae7c4aaea671e97020
BLAKE2b-256 0a9d626a1f0c11861707792266cef80dba3b7915e61e0e3d9856f27d3df95aae

See more details on using hashes here.

File details

Details for the file django_auditor_logs-2.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_auditor_logs-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4fe667f55ffaa1fee6a61a0814493f97e9cdb62fe3fcc54a3050261592da9fb5
MD5 6252b5cd9173296fd39240d52197d448
BLAKE2b-256 478be78acd9380104cca45b58a4d1e8b9691a4d6908ab712ac5341b3fc28afd0

See more details on using hashes here.

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