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

Uploaded Source

Built Distribution

django_timeline_logger-3.0.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for django-timeline-logger-3.0.0.tar.gz
Algorithm Hash digest
SHA256 9bd3e954100e28007307c9b57113f13ae392e5a30bcc574d7d1bf5bba74751ca
MD5 6f4c7fe01317ba1ecdb5fcd3e2e7db51
BLAKE2b-256 4d29c4eb872a22f67866274c2946242fef1153ef2b6522c2d436974e48b9dedd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_timeline_logger-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10e4220e2cf4f33dddc9299b40850431d514a266bdea685292a78477b7031fb0
MD5 ab44f2e8151617957c5ff1ac0e5f8f12
BLAKE2b-256 44bc3344f1166d474ed10c9f13347241cb365ce86c2a77e6a05f34b56d1cd6bd

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