# django-reversion

django-reversion is an extension to the Django web framework that provides version control for model instances.

## Features

- Roll back to any point in a model instance’s history.

- Recover deleted model instances.

- Simple admin integration.

## Installation

To install django-reversion:

1. Install with pip: `pip install django-reversion`.

2. Add `'reversion'` to `INSTALLED_APPS`.

3. Run `manage.py migrate`.

## Admin integration

django-reversion can be used to add rollback and recovery to your admin site.

Register your models with a subclass of reversion.admin.VersionAdmin.

    from django.contrib import admin
    from reversion.admin import VersionAdmin

    @admin.register(YourModel)
    class YourModelAdmin(VersionAdmin):

        pass

Hint

Whenever you register a model with django-reversion, run createinitialrevisions.

For more information about admin integration, see Admin integration.

## Low-level API

You can use the django-reversion API to build version-controlled applications. See django-reversion API.

## More information

### Installation

- Common problems
- django-reversion changelog

### Usage

- Admin integration
  - Overview
  - reversion.admin.VersionAdmin
- Management commands
  - createinitialrevisions
  - deleterevisions
- django-reversion API
  - Overview
  - Registration API
  - Revision API
  - reversion.models.VersionQuerySet
  - reversion.models.Version
  - reversion.models.Revision
- Views
  - Decorators
  - reversion.views.RevisionMixin
- Middleware
  - reversion.middleware.RevisionMiddleware
- Errors
  - reversion.RegistrationError
  - reversion.RevisionManagementError
  - reversion.RevertError
- Signals
  - reversion.signals.pre_revision_commit
  - reversion.signals.post_revision_commit