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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-timeline-logger-0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2ae81222f40fb4a1184e94871c8a38984f73f176350f02a4ea4fb2ab53a05b4 |
|
MD5 | 4ea405029572b2b3c7aadf5d1d34c109 |
|
BLAKE2b-256 | c1dd596f0a5cc15a2aa668d693dcc88b9bb2b1ff4016a5bd8789f9f51b9251fa |
Close
Hashes for django-timeline-logger-0.3.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f7ebd95c2c9419e0985cb7110384c01cd74b6e532da82b26926c6a26bf03bd0 |
|
MD5 | ac084ea223355bee6e6628075ae32d6b |
|
BLAKE2b-256 | 138e253e10a5f01910530ff928334607292ac38b8496f76e46e0030924829645 |