title: How to add django-reversion to an app developed using django and django-rest framework
body: <p>I have an app developed using Django and Django Rest framework. I would like to add the django-reversion feature to my app. </p>
  
  <p>I have already tried <a href="http://django-reversion.readthedocs.org/en/latest/api.html#low-level-api" rel="noreferrer">http://django-reversion.readthedocs.org/en/latest/api.html#low-level-api</a> but I have failed to make specific changes to my app. </p>
  
  <p>Below are the modules of the app where I would like to include the Django-reversion to restore objects if they get deleted. How to set the django-reversion configuration for the below modules</p>
  
  <p><strong>admin.py:-</strong> </p>
  
  <pre><code>from django.contrib import admin
  from.models import Category
  
  admin.site.register(Category)
  </code></pre>
  
  <p><strong>models.py:-</strong></p>
  
  <pre><code>  from django.db import models
    class Category(models.Model):
       name = models.CharField(max_length=64, unique=True)
  
       def __unicode__(self):
           return self.name
  </code></pre>
  
  <p><strong>serializers.py:-</strong></p>
  
  <pre><code>        from rest_framework import serializers
          from .models import Category
  
          class CategorySerializer(serializers.ModelSerializer):
                courses = serializers.HyperlinkedRelatedField(
                    many=True
                    read_only=True
                    view_name='course-detail'
                 )
                 class Meta:
                       model = Category
                       fields = ('pk', 'name', 'courses',)
  </code></pre>
  
  <p><strong>urls.py :-</strong></p>
  
  <pre><code>            from django.conf.urls import patterns, url
              from rest_framework.urlpatterns import format_suffix_patterns
              from .import views
              from django.conf.urls import include
  
              category_list = views.CategoryViewSet.as_view({
                  'get': 'list',
                  'post': 'create'
              })
  
              category_detail = views.CategoryViewSet.as_view({
                  'get': 'retrieve',
                  'put': 'update',
                  'patch': 'partial_update',
                  'delete': 'destroy',
             })
  
             urlpatterns = format_suffix_patterns([
  
                  url(r'^categories/$',
                      category_list,
                      name='category-list'),
                  url(r'^categories/(?P&lt;pk&gt;[0-9]+)/$',
                      category_detail,
                      name='category-detail'),
             ])
  
             urlpatterns += [
                 url(r'^api-auth/', include('rest_framework.urls',
                                            namespace='rest_framework')),
             ]
  </code></pre>
  
  <p><strong>views.py :-</strong></p>
  
  <pre><code>from rest_framework import permissions
  from rest_framework import viewsets
  from .models import Category
  from .serializers import CategorySerializer
  
  class CategoryViewSet(viewsets.ModelViewSet):
   queryset = Category.objects.all()
   serializer_class = CategorySerializer
   permission_classes = (permissions.IsAuthenticatedorReadOnly,)
  </code></pre>