postgresql 您的数据库 django 没有 South 数据库模块“south.db.postgresql_psycopg2”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29647602/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
There is no South database module 'south.db.postgresql_psycopg2' for your database django
提问by Shiva Krishna Bavandla
I have a django app with version as 1.6.5
, i am trying to upgrade it to 1.8
, but on the way i got the below error right after the django version was increased to 1.8
我有一个版本为 as 的 django 应用程序1.6.5
,我正在尝试将其升级到1.8
,但是在 django 版本增加到1.8
There is no South database module 'south.db.postgresql_psycopg2' for your database. Please either choose a supported database, check for SOUTH_DATABASE_ADAPTER[S] settings, or remove South from INSTALLED_APPS.
Code
代码
INSTALLED_APPS = [
'django_messages',
'avatar',
'tinymce',
'south',
'tracking',
......
]
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': '127.0.0.1',
'NAME': 'xxxxxx',
'USER': 'xxxxxx',
'PASSWORD': 'xxxxxx',
},
}
So what was the problem and what need to be done to fix this ?
那么问题是什么,需要做些什么来解决这个问题?
I have even tried with the below setting and receiving the same error when running the django local server
我什至尝试使用以下设置并在运行 django 本地服务器时收到相同的错误
SOUTH_DATABASE_ADAPTERS = {
'default': "south.db. postgresql_psycopg2"
}
回答by Shiva Krishna Bavandla
The solution i found to the above problem was just removing the south from virtual environment apart from all the changes mentioned above
除了上述所有更改之外,我发现上述问题的解决方案只是将南从虚拟环境中移除
回答by Douwe van der Meij
You are probably still referencing to South with an import somewhere.
您可能仍在引用 South 并在某处导入。
Just:
只是:
pip uninstall south
Then:
然后:
python manage.py runserver
And resolve import errors.
并解决导入错误。
回答by niconoe
Since Django 1.7, migrations are part of the framework. Instead of using South, you probably want to migrate to django.db.migrations.
从 Django 1.7 开始,迁移是框架的一部分。您可能想迁移到 django.db.migrations而不是使用 South 。
Generally speaking, you should always read release notes (for 1.7 and 1.8) when doing such an update.
一般来说,在进行此类更新时,您应该始终阅读发行说明(针对 1.7 和 1.8)。
回答by avs
Django with version >= 1.7 use built-in migration. You don't need to use south.
版本 >= 1.7 的 Django 使用内置迁移。你不需要使用南。
For more details about Django migration framework you can refer release note - https://docs.djangoproject.com/en/1.9/releases/1.7/#schema-migrations
有关 Django 迁移框架的更多详细信息,您可以参考发行说明 - https://docs.djangoproject.com/en/1.9/releases/1.7/#schema-migrations
Django docs - https://docs.djangoproject.com/en/1.8/topics/migrations/
Django 文档 - https://docs.djangoproject.com/en/1.8/topics/migrations/
Upgading from South - https://docs.djangoproject.com/en/1.8/topics/migrations/#upgrading-from-south
从南部升级 - https://docs.djangoproject.com/en/1.8/topics/migrations/#upgrading-from-south
回答by Rochan
If you are using Django < 1.7, you should also install South >= 1.0.1 if you haven't already. This is not listed as a dependency for the sake of users who are on Django >= 1.7 and don't need it.
如果你使用的是 Django < 1.7,你还应该安装 South >= 1.0.1 如果你还没有的话。为了在 Django >= 1.7 上不需要它的用户,这不被列为依赖项。