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

https://travis-ci.org/maykinmedia/django-timeline-logger.svg?branch=master https://codecov.io/gh/maykinmedia/django-timeline-logger/branch/develop/graph/badge.svg https://badge.fury.io/py/django-timeline-logger.svg

Prerequisites

This project uses django.contrib.postgres.JSONField, and as such, you need:

  • at least Django 1.11

  • at least PostgreSQL 9.4

  • at least psycopg2 2.5.4

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

Uploaded Source

Built Distribution

django_timeline_logger-1.1.2-py2.py3-none-any.whl (18.2 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for django-timeline-logger-1.1.2.tar.gz
Algorithm Hash digest
SHA256 18a0c182a3f2a3f7c0bdeba9ab207333621a6864644bdb91865eb55cfc9ccbe0
MD5 c49bf652cc095eae2cc13d54ffb2de72
BLAKE2b-256 5d9859cc01a61fea160522aa64e57c958bd7862043b37c7db0ed40d61a1b98b8

See more details on using hashes here.

File details

Details for the file django_timeline_logger-1.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_timeline_logger-1.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6cec977a4c08de3d7cce29cbfe3b00dadac9d99fa338331cb1a327062e78d228
MD5 6b803cb03b8304e1fa5f0921219504aa
BLAKE2b-256 9bd72d0a0a3c0c46cee7bfe314c955e6053ad2d9f639ed6f912a3557e27ffc1b

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