View, delete or disable Django admin log entries.
Project description
Log entries are automatically created by the Django framework whenever a user adds, changes or deletes objects through the admin interface.
Django Admin Logs is a package that allows you to either view the admin log entries from within the admin interface, or to disable them entirely.
Requirements
Python 3.8+
Django 4.2+
Installation
Install the package from PyPI:
pip install django-admin-logs
Then add it to your INSTALLED_APPS in the settings file:
INSTALLED_APPS = (
...
'django_admin_logs',
...
)
Configuration
By default, Django Admin Logs enables log entries to be viewed from within the admin interface but does not allow them to be deleted. Either of these options can be configured by adding the following to your settings file.
DJANGO_ADMIN_LOGS_DELETABLE = True
This allows super users, or any staff users with the delete_logentry permission, to delete log entries from within the admin interface.
DJANGO_ADMIN_LOGS_ENABLED = False
This disables admin log entries so that they are no longer created by the Django framework or viewable from within the admin interface.
By default, Django creates log entries with the message “No fields changed” when an unchanged object is saved in the admin interface. To prevent such log entries from being created use the following setting:
DJANGO_ADMIN_LOGS_IGNORE_UNCHANGED = True
Development
From the local project directory, activate the virtual environment and install the development requirements:
pip install -e .[dev]
To run tests for the installed version of Python and Django using pytest:
pytest
To run tests for all supported Python and Django versions using tox:
tox
To run tests for specific versions e.g. Python 3.10 and Django 4.2:
tox -e py310-django42
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
Built Distribution
File details
Details for the file django_admin_logs-1.3.0.tar.gz
.
File metadata
- Download URL: django_admin_logs-1.3.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57cd55f2dcc04592729b2778c03b86ba94cc64f5c2e286993114ca16464ff7e9 |
|
MD5 | 6ec70b61e8114c1667f841617ae440f3 |
|
BLAKE2b-256 | 392f357d3721b3e6bccb0c8091576723abca142f987688fe74d8e932ab4ea127 |
File details
Details for the file django_admin_logs-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: django_admin_logs-1.3.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9619f185beb09397223bf973f6574db29da50c3066cc25f800f04d58af4c595 |
|
MD5 | 9f46a422d1c047b42c08f1b77f3c7ca0 |
|
BLAKE2b-256 | fbee288a7c6314e23243becc1fd671ce1eaf957fe861022b12691181f98bf59b |