Metadata-Version: 2.4
Name: django-logentry-admin
Version: 1.2.0
Summary: Show all LogEntry objects in the Django admin site.
Author-email: Yuri Prezument <y@yprez.com>
License-Expression: ISC
Project-URL: Homepage, https://github.com/yprez/django-logentry-admin
Project-URL: Changelog, https://github.com/yprez/django-logentry-admin/blob/main/CHANGELOG.rst
Project-URL: Issues, https://github.com/yprez/django-logentry-admin/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Framework :: Django :: 6.1
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: Django>=5.2
Dynamic: license-file

=====================
django-logentry-admin
=====================

|ci| |pypi-version|

Show all LogEntry objects in the Django admin site.

Django records every addition, change and deletion made through the
admin, but only shows each user their own last few actions. This app
adds the whole log to the admin:

* a list of every entry, filtered by staff user, content type and
  action, searchable by object and change message, and browsable by
  date
* links from each entry to the object and the user it concerns, on
  the admin site you are using
* a read-only page per entry, since the log is a record: entries cannot
  be added, changed or deleted

Superusers see the log, and so do staff users with the "Can view log
entry" or "Can change log entry" permission. Either one only lets them
read it.

Originally based on `Django snippet 2484 <https://djangosnippets.org/snippets/2484/>`_.


Supported versions
==================

* Django 5.2, 6.0, 6.1
* Python 3.10 to 3.14 (Django 6.0 and later need Python 3.12 or later)


Installation
============

Install with pip:

.. code-block:: bash

    pip install django-logentry-admin

Or install from source:

.. code-block:: bash

    git clone https://github.com/yprez/django-logentry-admin.git
    cd django-logentry-admin
    pip install .

Then add it to ``INSTALLED_APPS``:

.. code-block:: python

    INSTALLED_APPS = [
        ...
        "logentry_admin",
    ]

The log appears in the admin under "Administration", as "Log entries".
It is translated into Azerbaijani, Brazilian Portuguese, Esperanto and
Russian.


Development
===========

The project uses `uv <https://docs.astral.sh/uv/>`_. Set up the
environment and run the tests with coverage:

.. code-block:: bash

    uv sync
    uv run coverage run -m pytest
    uv run coverage report

Run them against a particular Python and Django version, in a throwaway
environment that leaves the one above as it is:

.. code-block:: bash

    uv run --isolated --python 3.12 --with "django~=5.2.0" pytest

The translations need GNU gettext. After changing a message in the code,
update the catalogs, translate, compile them and commit both the ``.po``
and ``.mo`` files; CI checks that they match:

.. code-block:: bash

    cd src/logentry_admin
    uv run django-admin makemessages --all
    uv run django-admin compilemessages

To release, set the new version in ``pyproject.toml``, give it a dated
heading in the changelog (``v1.2.0 - 02/11/2026``), merge, then publish
a GitHub release tagged ``v<version>``. The release workflow refuses a
version whose changelog heading has no date, then builds it and uploads
it to PyPI.


.. |ci| image:: https://github.com/yprez/django-logentry-admin/actions/workflows/ci.yml/badge.svg?branch=main
    :target: https://github.com/yprez/django-logentry-admin/actions/workflows/ci.yml

.. |pypi-version| image:: https://img.shields.io/pypi/v/django-logentry-admin.svg
    :target: https://pypi.org/project/django-logentry-admin/

=========
Changelog
=========


v1.2.0 - 31/10/2026
===================

* Add support for Django 5.2, 6.0 and 6.1, and Python 3.10 to 3.14.
* Drop support for Django older than 5.2 and Python older than 3.10.
* Fix change messages showing as raw JSON (a regression in 1.1.0).
* Fix the translations, which never loaded: no release shipped the
  compiled catalogs.
* Fix the spelling of "Adição" in the Brazilian Portuguese translation.
* Show each log entry on a read-only page, without Save buttons.
* Fetch each entry's user with the list on Django 6.1, which stopped
  joining it on its own and ran one query per row.
* Fix links in a project with more than one admin site, which could lead
  to another site than the one in use.
* Fix links to objects whose text primary key contains a sequence the
  admin escapes, such as "_26".
* Fix the staff user filter for custom user models whose primary key is
  not named ``id``.
* Remove the ``get_actions()`` override that Django 6.1 deprecates.
* Package with ``pyproject.toml``, test on GitHub Actions, and publish to
  PyPI through trusted publishing.


v1.1.0 - 25/05/2021
===================

* Add tests/support for Django 3.2, 3.1.
* Add tests/support for Python 3.9.
* Drop support for Python 2.7, 3.4.
* Drop support for Django 1.x, 2.0, 2.1.


v1.0.6 - 23/04/2020
===================

* Add tests for Python 3.8, Django 3.0.
* Fix including locale files in wheel package.


v1.0.5 - 30/07/2019
===================

* Test on Python 3.7.
* Add tests for Django 2.1.
* Add tests for Django 2.2.
* Remove tests for Django 1.7.
* Fix translations, include locale files in the package.


v1.0.4 - 17/06/2018
===================

* Fix admin links for Django 2.0.


v1.0.3 - 14/12/2017
===================

* Add tests for Django 1.11 and 2.0 compatibility.
* Drop support for Python 3.2, 3.3.
* Make short_descriptions translatable in admin.py.
* Make use of new get_change_message() method on Django >= 1.11.
* Add Russian, Azerbaijani and Portuguese translations.


v1.0.2 - 12/08/2016
===================

* Add tests for Django 1.10 compatibility.


v1.0.1 - 24/07/2016
===================

* Add tests and support for Django 1.9 and Python 3.5.
* Drop support for Python 2.5, 2.6, Django 1.4, 1.5, 1.6.
* Fix AttributeError when content_type is None, issue `#21 <https://github.com/yprez/django-logentry-admin/issues/21>`_.
* Show log entries for users with change_logentry permission, `#25 <https://github.com/yprez/django-logentry-admin/pull/25>`_.
* Test with py.test instead of unittest.


v0.1.5 - 17/02/2015
===================

* Django 1.8 compatibility.


v0.1.4 - 28/09/2014
===================

* Added Django 1.7 compatibility.
* Fixed compatibility issues with Django 1.5, 1.4 and Python 3.2.
* Added tests.


v0.1.3 - 02/06/2014
===================

* Improved display layout.
* Added links to user and object.
* Added "By staff user" filter.
* Don't allow delete action for LogEntry.
* Better performance by prefetching content types.


v0.1.2 - 26/08/2013
===================

* Added an empty model.py file.
* Minor documentation (readme) updates/fixes.


v0.1.1 - 28/12/2011
===================

* Added object links and action description.


v0.1.0 - 26/12/2011
===================

* Initial release.
