Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

xyngular/django-history

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Model History Tracking

For every model for which you want to track data changes, add to settings

HISTORY = {
    'MODELS': {
        'app_namer.Model': {
            'publish_to_queue': True,
            # 'exchange_name': 'app_name.model.change'  # optional
        },
        'app_name.Model': None,
    },
    'BROKER_URL': os.getenv('HISTORY_BROKER_URL', DEFAULT_BROKER_URL),
    'SERVICE_NAME': 'memberapi',
}

Models listed will have their changed saved to a model history table. If BROKER_URL is set, all changes for models with publish_to_queue=True will be sent to a kombu exchange (i.e. RabbitMQ) so other services can listen to events. In that case, SERVICE_NAME should also be set.

About

Track data changes to Django models

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages