Giter Site home page Giter Site logo

jzmiller1 / django-pghistory Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opus10/django-pghistory

0.0 1.0 0.0 5.18 MB

Track historical events to Django models using Postgres triggers.

License: Other

Python 95.98% Makefile 2.91% Smarty 1.10%

django-pghistory's Introduction

django-pghistory

django-pghistory provides automated and customizable history tracking for Django models using Postgres triggers. Users can configure a number of event trackers to snapshot every model change or to fire specific events when certain changes occur in the database.

In contrast with other Django auditing and history tracking apps (seen here), django-pghistory has the following advantages:

  1. No instrumentation of model and queryset methods in order to properly track history. After configuring your model, events will be tracked automatically with no other changes to code. In contrast with apps like django-reversion, it is impossible for code to accidentally bypass history tracking, and users do not have to use a specific model/queryset interface to ensure history is correctly tracked.
  2. Bulk updates and all other modifications to the database that do not fire Django signals will still be properly tracked.
  3. Historical event modeling is completely controlled by the user and kept in sync with models being tracked. There are no cumbersome generic foreign keys and little dependence on unstructured JSON fields for tracking changes, making it easier to use the historical events in your application (and in a performant manner).
  4. Changes to multiple objects in a request (or any level of granularity) can be grouped together under the same context. Although history tracking happens in Postgres triggers, application code can still attach metadata to historical events, such as the URL of the request, leading to a more clear and useful audit trail.

To get started, read the django-pghistory docs. The docs covers how to set up and configure automated event tracking in your application, along with how to aggregate events for objects and visualize them in your admin/application.

Documentation

View the django-pghistory docs here.

Installation

Install django-pghistory with:

pip3 install django-pghistory

After this, add pghistory to the INSTALLED_APPS setting of your Django project.

Contributing Guide

For information on setting up django-pghistory for development and contributing changes, view CONTRIBUTING.rst.

Primary Authors

Other Contributors

  • @shivananda-sahu
  • @asucrews
  • @Azurency
  • @dracos
  • @adamchainz
  • @eeriksp

django-pghistory's People

Contributors

wesleykendall avatar shivananda-sahu avatar tomage avatar adamchainz avatar eeriksp avatar dracos avatar jzmiller1 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.