|
GettingStarted
Getting started with Reversion.
Deprecated Getting StartedReversion 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. InstallationTo install Reversion, follow these steps:
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 IntegrationTo 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 APIFor 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. |
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
it giving error 'admin' is not a registered namespace
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.
Is it possible to versionize a user Admin?
Dave Hall gave me this ansser on the mailing list:
In one of your own admin.py files, just add in: