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 Coverage status black

python-versions django-versions pypi-version

Prerequisites

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

  • at least Django 3.2+

  • a database supporting django.db.models.JSONField

  • A modern setuptools version

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.

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-4.0.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

django_timeline_logger-4.0.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file django-timeline-logger-4.0.0.tar.gz.

File metadata

  • Download URL: django-timeline-logger-4.0.0.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for django-timeline-logger-4.0.0.tar.gz
Algorithm Hash digest
SHA256 3b90a5af4aa94c6413024447207ad116890acb24b1defe6d9d875cf9f386a786
MD5 b14ee515b9abdb4b21b95bbbdc3da31a
BLAKE2b-256 094ff2e3ace242da0fb4fb3c2a0db222ba013d6b74662c5d2032b578ef28a2dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_timeline_logger-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 979150eddb621263283fbdfa20b186948662775a59e6bf7ccfbaf6593b994ebe
MD5 5e583c2f05a3a6078c8be11985a45c0e
BLAKE2b-256 efdfbc700c18f93a9be9e096d0b333344570ad26d4719757e233ecf8c09f2f40

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page