Skip to main content

django-admin-blame

django-admin-blame is a Django app providing mixins for tracking date and author of model changes from django admin.

Build Status codecov PyPI version

Description

Often it is useful to know date and author of object creation or modification. django-admin-blame provides a django model mixin with fields:

  • created (datetime) - timestamp of object creation
  • created_by (FK to User) - reference to an admin user who created this object through admin site
  • modified (datetime) - timestamp of last object modification
  • modified_by (FK to User) - reference to an admin user who made last changes to this object through admin site. If changes has been made somewhere else, field value is reset to None.

Installation

pip install django-admin-blame

Working example is in testproject.testapp.

  1. Enable middleware in django settings:
    MIDDLEWARE.append('admin_log.middleware.AdminLogMiddleware')
    
  2. Add model mixin to your models:
    from django.db import models
    
    from admin_log.models import AdminLogMixin
    
    
    class Subject(AdminLogMixin, models.Model):
        title = models.CharField(max_length=50)
        content = models.TextField()
    
  3. Add admin mixin to corresponding model admin:
    from django.contrib import admin
    
    from admin_log.admin import AdminLogMixin
    from testproject.testapp import models
    
    
    @admin.register(models.Subject)
    class SubjectAdmin(AdminLogMixin, admin.ModelAdmin):
        pass
    

Now you have readonly fields with date and author of last revision in admin "edit" page.

Metadata

Release files for django-admin-blame 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-admin-blame 1.1.1
File Size Uploaded
django-admin-blame-1.1.1.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-admin-blame 1.1.1
File Interpreter ABI Platform
django_admin_blame-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / django-admin-blame-1.1.1.tar.gz

Download URL django-admin-blame-1.1.1.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9abdd22fadce64462de0e6e52845138d5fffd60485e1c806df4ea88ddd95d88d
BLAKE2b-256 checksum
How to use checksums
50fb6facff12c608728a457dd2fdc3526be7520d9081b201278d4648b234b12d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / django_admin_blame-1.1.1-py3-none-any.whl

Download URL django_admin_blame-1.1.1-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
22588c22a017c2bb098b76461bcd4d6d85c4675280550b641f6d28f935cda5c2
BLAKE2b-256 checksum
How to use checksums
ea6ecc26a1ada5de4961f430753fd41a0828b482aedf059e64b26b431c029d3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.5

2 release files

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page