Django中PostgreSQL数据库的使用

下载所需库

pip install psycopg2-binary

settings.py中的配置(本地)

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': '<数据库名称>',
        'USER': '<用户名>',
        'PASSWORD': '<密码>',
        'HOST': '',
        'PORT': '',
    }
}

猜你喜欢

转载自www.cnblogs.com/rn-05181226-rw/p/12418373.html