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
我有一个版本为1.6.5的django应用程序,我正在尝试将其升级到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"
}
5 个解决方案
#1
43
The solution i found to the above problem was just removing the south from virtual environment apart from all the changes mentioned above
我发现上述问题的解决方案只是将虚拟环境中的南方移除,而不是上面提到的所有变化
#2
9
You are probably still referencing to South with an import somewhere.
你可能仍然在某个地方导入南方。
Just:
只是:
pip uninstall south
Then:
然后:
python manage.py runserver
And resolve import errors.
并解决导入错误。
#3
2
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)。
#4
1
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 docs - 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
#5
0
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并且不需要它的用户,这不会被列为依赖项。
#1
43
The solution i found to the above problem was just removing the south from virtual environment apart from all the changes mentioned above
我发现上述问题的解决方案只是将虚拟环境中的南方移除,而不是上面提到的所有变化
#2
9
You are probably still referencing to South with an import somewhere.
你可能仍然在某个地方导入南方。
Just:
只是:
pip uninstall south
Then:
然后:
python manage.py runserver
And resolve import errors.
并解决导入错误。
#3
2
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)。
#4
1
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 docs - 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
#5
0
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并且不需要它的用户,这不会被列为依赖项。