My favorites | Sign in
Project Home
Search
for
GettingStarted  
Getting started with Reversion.
Deprecated
Updated Aug 6, 2010 by david.et...@gmail.com

Getting Started

Reversion is an extension to the Django web framework that provides comprehensive version control facilities.

It can be easily added to your existing Django project with an absolute minimum of code changes.

Installation

To install Reversion, follow these steps:

  1. Checkout the latest Reversion release into your PYTHONPATH. The latest release can be found at http://django-reversion.googlecode.com/svn/tags/1.3.1/src/reversion.
  2. Add 'reversion' to your INSTALLED_APPS setting.
  3. Run the command manage.py syncdb.

Please note: If you have a large number of models under version control, the initial syncdb command might take a while to run, since Reversion must create an initial revision for each model.

The latest release of Reversion is designed to work with Django 1.2. If you have installed anything other than the latest version of Django, please check the CompatibleDjangoVersions page before downloading Reversion.

There are a number of alternative methods you can use when installing Reversion. Please check the InstallationMethods page for more information.

Admin Integration

To activate version control for a model, simply register it with a subclass of reversion.admin.VersionAdmin:

from django.contrib import admin
from reversion.admin import VersionAdmin
from yoursite.models import YourModel

class YourModelAdmin(VersionAdmin):
    """Admin settings go here."""

admin.site.register(YourModel, YourModelAdmin)

It's that simple!

Low-Level API

For most projects, simply activating the admin integration will satisfy all your version-control needs. However, Reversion comes with a lower-level API that allows you to manage versions within your own code. Please see the LowLevelAPI documentation for more information.

Comment by gerdzell...@gmail.com, May 11, 2010

If you get Exception Type: NoReverseMatch? Exception Value: 'admin' in your adminarea with django-reversion you might want to try this: http://serverfault.com/questions/78413/django-reversion-and-apache-trouble

Comment by ankit9...@gmail.com, May 13, 2010

it giving error 'admin' is not a registered namespace

Comment by mdorns...@gmail.com, May 15, 2010
ankit9ims:

You probably use the "old" way to include your admin in urls.py: (r'^admin/(.)', admin.site.root),

Try (r'^admin/', include(admin.site.urls)), instead and you should be fine.

Comment by alessand...@gmail.com, Aug 2, 2010

Is it possible to versionize a user Admin?

Comment by h...@tbz-pariv.de, Jun 20, 2011

Dave Hall gave me this ansser on the mailing list:

In one of your own admin.py files, just add in:

from django.contrib.auth.models import User from reversion.helpers import patch_admin patch_admin(User)

Sign in to add a comment
Powered by Google Project Hosting