Skip to main content

Generic event logger for Django models.

Project description

# django-timeline-logger
A reusable Django app to log actions and display them in a timeline


[![Build Status](https://travis-ci.org/maykinmedia/django-timeline-logger.svg?branch=master)](https://travis-ci.org/maykinmedia/django-timeline-logger)
[![codecov](https://codecov.io/gh/maykinmedia/django-timeline-logger/branch/develop/graph/badge.svg)](https://codecov.io/gh/maykinmedia/django-timeline-logger)
[![Coverage Status](https://coveralls.io/repos/github/maykinmedia/django-timeline-logger/badge.svg?branch=master)](https://coveralls.io/github/maykinmedia/django-timeline-logger?branch=master)
[![PyPI version](https://badge.fury.io/py/django-timeline-logger.svg)](https://badge.fury.io/py/django-timeline-logger)


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

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

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django-timeline-logger-0.4.1.tar.gz
Algorithm Hash digest
SHA256 30eaa8b32e5d70355a0c879b84b4d2e83c8e26d2435ebe35cefa6a74bd5040bc
MD5 d2271b4c82ef3c28dab76dfb1b16ac04
BLAKE2b-256 149272f207f0b517819c49bc6c74a2d2ab4664abca482dff0d9448a5aa5887c7

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