Skip to main content

A set of Django mixins to easily record authorship information for your models.

Project description Documentation Status

A set of Django mixins to easily record authorship information for your models.


  • Base model allows easy recording of authorship information.

  • Integration with Django’s class-based views and forms.

  • Integration with Django’s admin.


The full documentation is at


Install django-authorship using the installation instructions found in the project documentation.

Build a model based on authorship.models.Authorship to record authorship information on it:

from authorship.models import Authorship

class MyModel(Authorship):


This adds created_by, created_at, updated_by, and updated_at to your model.

Pass a user into calls to .save() to record which user changed the object:

example = MyModel()

If you need to update model data and there’s no direct link to a website user, generate and use a site-wide ‘generic’ user.:

from authorship.models import get_website_user

example = MyModel()

If you wish to automatically record authorship information for changes made in the Django admin, use authorship.admin.AuthorshipMixin.:

from authorship.admin import AuthorshipMixin
from django.contrib import admin

from .models import MyModel

class MyModelAdmin(AuthorshipMixin, admin.ModelAdmin):


If you wish to integrate with django.forms.ModelForm, use authorship.forms.AuthorshipMixin and authorship.views.AuthorshipMixin.

In your

from authorship.forms import AuthorshipMixin
from django import forms

from .models import MyModel

class MyModelForm(forms.ModelForm):

    class Meta(object):
        model = MyModel

In your

from authorship.views import AuthorshipMixin
from django.views.generic import CreateView

from .forms import MyModelForm
from .models import MyModel

class MyModelCreateView(AuthorshipMixin, CreateView):

    form_class = MyModelForm

MyModelCreateView will now automatically pass request.user through to MyModelForm, which will pass it through to the model’s save() method.


See AUTHORS.rst.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_authorship-2.0.0-py3-none-any.whl (14.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page