【发布时间】:2016-07-12 20:47:36
【问题描述】:
我已经从 github 克隆了一个 repo 并正在处理它。该项目在 django 中并使用 postgres 作为数据库。这个项目现在处于生产端,我需要对其进行一些更改。数据库规格是:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
# Or path to database file if using sqlite3.
'NAME': 'project_name',
'USER': 'admin',
'PASSWORD': '',
# Empty for localhost through domain sockets or '127.0.0.1'
# for localhost through TCP.
'HOST': 'localhost',
'PORT': '5432',
}
}
我想在我的本地主机上运行它,但我不能。我收到错误:
django.db.utils.OperationalError: fe_sendauth: no password supplied
我已经搜索过这个问题,但找不到可以帮助我的解决方案。谁能告诉我问题出在哪里?
【问题讨论】:
-
您是否使用 project_name 和 'admin' 用户创建了数据库。你确定不需要密码吗?
-
是的,我尝试在 PgAdminIII 中创建数据库,但也出现了同样的错误。
-
您的数据库似乎有问题。为什么不在终端
psql -U postgres中尝试以下命令,然后是create database project_name;。如果可行,请将设置中的用户更改为 postgres -
你最后搞定了吗?
标签: django git postgresql operationalerror