Skip to content

Application that helps your models to keep track of all their changes.

License

Notifications You must be signed in to change notification settings

djbook-ru/django-mlogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django action logger

Installation

  • Install this package into virtual environment of your project.

  • Add the following lines into settings.py:

    INSTALLED_APPS += ('mlogger',)
    MIDDLEWARE_CLASSES += ('mlogger.middleware.CurrentUserMiddleware',)
    

Usage

  • Add into your models.py:

    from mlogger.models import logging_postsave, logging_postdelete
    
  • Then connect signals to logging handlers:

    models.signals.post_save.connect(logging_postsave, sender=YourModelName)
    models.signals.post_delete.connect(logging_postdelete, sender=YourModelName)
    
  • Get changes:

    from mlogger.models import Log
    Log.objects.all()
    

Conclusion

It's pretty easy!

About

Application that helps your models to keep track of all their changes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages