Prevent django admin changes from creating a LogEntry
Asked Answered
R

1

1

I want to use the Django admin so I include django.contrib.admin in my middleware, but by default this adds a django_log_entry table and triggers the creation of a log entry on all additions, changes, and deletions. How do I prevent this behavior? Should I overwrite the LogEntry model or can I simply unregister it? I can't seem to find any documentation.

I'm using Django 2.1

Roemer answered 6/11, 2019 at 18:55 Comment(0)
G
3

I've created a Django Python package that allows you to disable admin log entries. To use it:

  1. Install from PyPI:

    pip install django-admin-logs

  2. Include it in your INSTALLED_APPS settings:

    INSTALLED_APPS = (
        ...
        'django_admin_logs',
        ...
    )
  1. Also add the following to your settings file:

    DJANGO_ADMIN_LOGS_ENABLED = False

This will stop Django from creating admin log entries.

Guido answered 8/3, 2020 at 22:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.