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.9

  • 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-0.5.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

django_timeline_logger-0.5.1-py2.py3-none-any.whl (12.4 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for django-timeline-logger-0.5.1.tar.gz
Algorithm Hash digest
SHA256 6c85d34c3f7b08eee3e18c1a61ce4fbcc5b6d5524ae87faadb92ae425ab2347e
MD5 36f519d53e943f15eff4142f2f513a06
BLAKE2b-256 ca6ac401b4ed693783b5f3d6eb964eeb43e6f7721ce36d070f5117a45039bb71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_timeline_logger-0.5.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 98ccb48101a9c02dbe8a11bcc6dfa91e615cafe527a9e9535755e39b62bf5824
MD5 31966069f87f53f5a77f602f657797ba
BLAKE2b-256 89cdd8b8567d541713c6e50f6d2a17f9ff740bec49c88ca5746959b1d059fb71

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