Skip to main content

History for Django ORM data changes

Project description

:authors: Jussi Vaihia
:organization: Futurice
:copyright: 2014 Futurice

django-history
==============

**django-history** helps you track all data changes for registered models.

Features
--------
- Tracks ForeignKeys and ManyToManyFields

::
For Django 1.5+, Python 2.7+.

Add to models you want to track history for, eg.

from djangodirtyfield.mixins import DirtyFieldMixin
class BaseModel(models.Model, DirtyFieldMixin):
...

Add to available apps for templates to work:

INSTALLED_APPS += (
'djangohistory',)

To enable storing request.user information:

MIDDLEWARE_CLASSES += (
'djangohistory.middleware.ThreadLocals',)

Or, if already a similar setup, configure:
DJANGO_HISTORY_SETTINGS['GET_CURRENT_REQUEST'] = ('my.middleware', 'current_request_function')

View changesets by enabling routing:

urlpatterns = patterns('',
url(r'^history/', include('djangohistory.urls')),
)

All changes:
/history/latest

Changes by Content Type:
/history/by/?ct_id=

Changes by specific Model instance:
/history/by/?ct_id=&id=


Diffs for changes can be enabled optionally:

DJANGOHISTORY_DIFF_ENABLED = True
pip install diff-match-patch==20121119

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-history-0.2.0.tar.gz (12.9 kB view details)

Uploaded Source

File details

Details for the file django-history-0.2.0.tar.gz.

File metadata

File hashes

Hashes for django-history-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4f1625062b68c054ccac5d9b396ad010ea9127b90d42045afa1ad4e8e82968cb
MD5 e43306d1e628a6930f319b7df52c66be
BLAKE2b-256 5ac93a815e3129c027fd2e8dfebe8b2ee8bf5b8ab4131468e335aea0c8f9013e

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