浏览 3703 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2009-04-30
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. 使用步骤 1. checkout http://django-evolution.googlecode.com/svn/trunk/ 获取源代码 2. cd django_evolution -> python setup.py install 安装 3. 修改你的django项目的settings.py的INSTALLED_APPS项,比如 INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django_evolution' ) 4.进入你的django项目文件夹, python manage.py syncdb创建 django_evolution所需的表 5.python manage.py evolve --hint --execute 根据实体同步修改你的数据表 over 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |