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

家住魔仙堡 提交于 2019-12-18 18:59:17

问题


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.

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:

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.clickjacking.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 = 'webmaster@example.com'





# ----------------------------
    # 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.


回答1:


This happened to me when I upgraded various modules using pip and 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").




回答2:


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




回答3:


Please note that South is 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.

For more details about Django migration framework you can refer release note - 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.




回答4:


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.




回答5:


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)



来源:https://stackoverflow.com/questions/29478400/there-is-no-south-database-module-south-db-postgresql-psycopg2-for-your-databa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!