Django-modify-history is a project mainly written in Python, it's free.
Automatically create object modify history on Django
This application will create history table for each object in Django
sudo pip install django-modify-history
or
git clone git://github.com/alisue/django-modify-history.git
sudo pip install django-modify-history/
or download repository and copy it to somewhere in PYTHON_PATH
modify_history
to INSTALLED_APPS
manage.py syncdb
Add history_site.py
to the app and write like below
from modify_history import site
from modify_history.backends.basic import BasicHistoryBackend
from models import Article
class ArticleBackend(BasicHistoryBackend):
pass
site.register(Article, ArticleBackend)
Use get_history_timelines
template tags for get history list like below
{% extends 'base.html' %}
{% load historytags %}
{% block content %}
<h2>History</h2>
<ul>
{% get_history_timelines as timelines %}
{% for timeline in timelines %}
<li>{{ timeline.get_message }} at {{ timeline.created_at|date }}</li>
{% endfor %}
</ul>
{% endblock %}
HISTORY_ENABLE
: Make history enable, to disable history app just set this False
HISTORY_USER_ATTRS
: modify_history app find user from target object's attrs. this is the list of name
of attrs. default is ['updated_by', 'user', 'author', 'created_by']