Django_evolution: A good Django database version plug-in
Source: Internet
Author: User
Django's official manage. py syncdb can only create data tables synchronously based on existing models, but cannot modify data tables synchronously Based on objects like rails. Fortunately, a third-party plug-in can provide this function.
Django_evolution
When you run. /manage. PY syncdb, Django will look for any new models that have been defined, and add a database table to represent those new models. however, if you make a change to an existing model ,. /manage. PY syncdb will not make any changes to the database.
This is where Django evolution fits in. Django evolution is an extension to Django that allows you to track changes in your models over time, and to update the database to reflect those changes.
Procedure
1. Checkout Http://django-evolution.googlecode.com/svn/trunk/ ObtainSource code
2. CD django_evolution-> install Python setup. py install
3. Modify the installed_apps item of settings. py of your Django project, such
Installed_apps = (
'Django. contrib. admin ',
'Django. contrib. auth ',
'Django. contrib. contenttypes ',
'Django. contrib. session ',
'Django. contrib. Sites ',
'Django _ evolution'
)
4. Go to your Django project folder, and create the tables required for django_evolution using Python manage. py syncdb.
5. Python manage. py evolve -- hint -- execute modify your data table synchronously Based on the object
Over
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service