我正在关注djano-rest-framework教程。我正在尝试为数据库迁移添加南。这就是我pip freeze
的样子:
Django==1.8.1
djangorestframework==3.1.2
MySQL-python==1.2.5
Pygments==2.0.2
South==1.0.2
tutorial
项目的我的settings.py如下所示:
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'snippets',
'south'
)
...
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'snippets',
'HOST': 'localhost',
'PORT': 3306,
'USER': 'abcd',
'PASSWORD': ''
}
}
SOUTH_DATABASE_ADAPTERS = {
'default': 'south.db.mysql'
}
运行./manage.py syncdb
时出现以下错误:
/home/superq/learn-django/env/lib/python2.7/site-packages/south/db/generic.py:9: RemovedInDjango19Warning: The django.db.backends.util module has been renamed. Use django.db.backends.utils instead.
from django.db.backends.util import truncate_name
There is no South database module 'south.db.mysql' for your database. Please either choose a supported database, check for SOUTH_DATABASE_ADAPTER[S] settings, or remove South from INSTALLED_APPS.
我已多次安装和卸载南。有什么想法吗?
答案 0 :(得分:1)
您正在使用Django 1.8。没有理由添加South:自1.7以来Django的版本包含内置迁移。实际上,南方文档明确声明它与1.7 +不兼容。