Python 您的数据库没有 South 数据库模块“south.db.postgresql_psycopg2”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29478400/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 04:38:05  来源:igfitidea点击:

There is no South database module 'south.db.postgresql_psycopg2' for your database

pythondjangodjango-south

提问by ferprez

i new to django and I'm getting this error from south but i don't know what i'm missing. I search for answers but i can't found anything.

我刚接触 django,我从南方收到这个错误,但我不知道我错过了什么。我寻找答案,但我什么也找不到。

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.

This is my base_settings:

这是我的 base_settings:

from unipath import Path

BASE_DIR = Path(__file__).ancestor(3)


SECRET_KEY = 'pp@iz7%bc7%+*11%usf7o@_e&)r2o&^3%zjse)n=6b&w^hem96'

DJANGO_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

)

THIRD_PARTY_APPS = (
    'south',

)

LOCAL_APPS = (


)


INSTALLED_APPS = DJANGO_APPS + THIRD_PARTY_APPS + LOCAL_APPS


MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickHymaning.XFrameOptionsMiddleware',
    'django.middleware.security.SecurityMiddleware',
)

ROOT_URLCONF = 'misite.urls'

WSGI_APPLICATION = 'misite.wsgi.application'

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

local_settings:

本地设置:

from .base import *

TEMPLATE_DEBUG = True



ALLOWED_HOSTS = []

DEBUG = True

DEFAULT_FROM_EMAIL = '[email protected]'





# ----------------------------
    # POSTGRESQL

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'misite',
        'USER:': 'fernandoperez',
        'PASSWORD': 'admin',
        'HOST':'localhost',
        'PORT':'5432',
    }
}

SOUTH_DATABASE_ADAPTERS = {
     'default': "south.db.postgresql_psycopg2"
 }

STATIC_URL = '/static/'

Can someone help me?? Thanks a lot.

有人能帮我吗??非常感谢。

采纳答案by kravietz

This happened to me when I upgraded various modules using pipand one of the dependencies automatically upgraded Django to the current version (1.8). You might just check what is your current Django version (pip freeze) and if it's 1.8 just downgrade to 1.6 line (pip install -U "Django<1.7").

当我使用升级各种模块时发生了这种情况pip,其中一个依赖项自动将 Django 升级到当前版本 (1.8)。您可能只是检查一下您当前的 Django 版本 ( pip freeze),如果它是 1.8,只需降级到 1.6 行 ( pip install -U "Django<1.7")。

回答by Lahiru

But the point is how to fix the issue keeping django 1.8 (latest version). I do not think down grading to 1.6 is a good idea because django 1.6 is not a secure version anymore.

但关键是如何解决保持 django 1.8(最新版本)的问题。我不认为降级到 1.6 是一个好主意,因为 django 1.6 不再是一个安全的版本。

回答by Papa Sax

Try pip uninstall South, then you will see if your application is 1.8 ready.

尝试pip uninstall South,然后您将看到您的应用程序是否已准备好 1.8。

回答by WangST

Please note that Southis now end of lifed in favour of the ?new migrations framework in Django 1.7, which is based on South but with significant design improvements.

请注意,为了支持 Django 1.7 中的 ?new migrations 框架,South现在已经停止使用,该框架基于 South,但具有重大的设计改进。

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

South will not work with Django 1.7; It supports only versions 1.4, 1.5 and 1.6.

South 不适用于 Django 1.7;它仅支持 1.4、1.5 和 1.6 版本。

回答by Rafael

Using django 2.2.4 I realized that "south" was being included in one of my third party installed apps (socket_server). But not on the module, rather, in the migration policies (maybe the guys who created the module are still using an old version of django). So, changed the name from 0001_inicial.py to 0001_inicial_old and django was not able to find it and generated another. worked as half-measure (socket should install without it)

使用 django 2.2.4 我意识到“south”被包含在我的第三方安装的应用程序之一(socket_server)中。但不是在模块上,而是在迁移策略中(也许创建模块的人仍在使用旧版本的 django)。因此,将名称从 0001_inicial.py 更改为 0001_inicial_old 并且 django 无法找到它并生成了另一个。作为半措施工作(插座应该在没有它的情况下安装)