Skip to main content

Generic event logger for Django models.

Project description

A reusable Django app to log actions and display them in a timeline

Build status Code quality checks Ruff Coverage status Documentation Status

python-versions django-versions pypi-version

Prerequisites

This project uses django.db.models.JSONField, and as such, you need:

  • Django 4.2+

  • a database supporting django.db.models.JSONField

Installation

Install from PyPI by running

pip install django-timeline-logger

Add 'timeline_logger' to your INSTALLED_APPS.

Run the migrations:

python manage.py migrate

Usage in templates

A custom template tag is provided to render the message of a log entry, for example:

{% extends "timeline_logger/base.html" %}
{% load timeline %}

{% block timeline %}
    <ul class="timeline__list col__22--vw">
    {% for log in object_list %}
        <li class="timeline__entry">
            {% render_message log in_view=True %}
        </li>
    {% endfor %}
    </ul>
{% endblock timeline %}

This way, you can pass extra context to the template used for the log object.

Documentation

The extended documentation is available on Read the Docs.

Local development

To install and develop the library locally, use:

pip install -e .[tests,docs,release]

When running management commands via django-admin, make sure to add the root directory to the python path (or use python -m django <command>):

export PYTHONPATH=. DJANGO_SETTINGS_MODULE=tests.settings_pg
django-admin check
# or other commands like:
# django-admin makemessages -l nl

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_timeline_logger-6.0.0.tar.gz (23.0 kB view details)

Uploaded Source

Built Distribution

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

django_timeline_logger-6.0.0-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file django_timeline_logger-6.0.0.tar.gz.

File metadata

  • Download URL: django_timeline_logger-6.0.0.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_timeline_logger-6.0.0.tar.gz
Algorithm Hash digest
SHA256 e8ef0f9ae3fd62f679ca849eeaae4bf112f31333995d3f3b84c2df1faef6f569
MD5 c868f4234599e448e8ddadbc43f21701
BLAKE2b-256 afac5cced563e8aa2d3a33fb1df6d3dd52e3007cb672a68db89973b14026b160

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_timeline_logger-6.0.0.tar.gz:

Publisher: ci.yml on maykinmedia/django-timeline-logger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_timeline_logger-6.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_timeline_logger-6.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a626c3a872b15f32a513cf227a2dfd2b4d8a39c66fe987a3a5127bb58c5ca020
MD5 3ce3d2539a824ebd92568ba7f38dced1
BLAKE2b-256 4576de295c4f6144b63fe4db9b46724a3d3a64a11528c494b2346b6ec63ed12a

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_timeline_logger-6.0.0-py3-none-any.whl:

Publisher: ci.yml on maykinmedia/django-timeline-logger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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