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

Uploaded Source

Built Distribution

django_timeline_logger-1.1.1-py2.py3-none-any.whl (15.8 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for django-timeline-logger-1.1.1.tar.gz
Algorithm Hash digest
SHA256 45275a988ca13e0213e1d1a6f3190690cc20c43dded803a4d540a4bccb67544f
MD5 7eae88a0dd27ef3336ecbd463bba717a
BLAKE2b-256 4c0bbfaee555f171f8e2d20ebdb7e200ad8ec45ff1c5b8f95bd0dda1b627949a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_timeline_logger-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cdcd23337dfb5cc4f3477b3303097d306b108daff17db42a3df0f4df4470cb73
MD5 f6fc4e7a083b30e39518b5f9d038a2b2
BLAKE2b-256 4901673f467c6d83e65801c07b12042fe039bab37acb3286fae7bc68822fc639

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