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

Uploaded Source

Built Distribution

django_timeline_logger-5.0.0-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for django_timeline_logger-5.0.0.tar.gz
Algorithm Hash digest
SHA256 07a623bced21069df84cd872003e749186fd10288ac8fb8e70d0bd0c9461629b
MD5 5498b982724773920bea1464caee56c5
BLAKE2b-256 ea3c053673b3b1a105ea20cb1a967896116dda5b12a5ecaf75a454aa77e6a20a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_timeline_logger-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edbc35eda95e9c9e1bb00dd4a7044a356f791613906597ff4390b02add6ef1e5
MD5 2457787c965190d6b6bc4dcff62fa59c
BLAKE2b-256 400b8d4f833b011fc2c082725c79eb6adb1e0f718e47823b7652947c4771b399

See more details on using hashes here.

Supported by

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