我是django和postgresql的初学者,我试图连接数据库,但是在运行“ python manage.py makemigrations”时出错:
File "/home/trainee/portfolio/venvportfolio/lib/python3.6/site-
packages/psycopg2/__init__.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: SSL error: unknown protocol
expected authentication request from server, but received S
requirement.txt:
Django==2.1.3
Pillow==6.0.0
psycopg2==2.7.4
psycopg2-binary==2.7.4
pytz==2019.1
settings.py:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'portfolio',
'USER': 'username',
'PASSWORD': 'password',
'HOST': 'localhost',
'PORT': '22'
}
}