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.contrib.postgres.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-2.1.0.tar.gz (11.2 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-2.1.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for django-timeline-logger-2.1.0.tar.gz
Algorithm Hash digest
SHA256 60e8e23574207073e76856dda8e42df5da609bfb2f7575f6e16da91eb4092a48
MD5 cf2fc8ea4e36cf3dc1eb7ea533c2c167
BLAKE2b-256 f7dd6b6dc60ad7674c9d570d53a52436059db8a99a92393fd63aa75f8cea5d1c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_timeline_logger-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e38a14c5d574a506d373898c7bce6613da1a5195aae6af772bad94a91a7a2a1e
MD5 d10d47d860c1ac513570dbcea585769e
BLAKE2b-256 80d060d93df81c08122267dfc9221a48effabb29f733f43f356261a9dddb61d3

See more details on using hashes here.

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