我从Github克隆了一个仓库并正在对其进行操作。该项目基于Django框架,使用PostgreSQL作为数据库。此项目现在已上线,我需要对其进行一些更改。数据库规格如下:
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
我已经搜索了这个问题,但是找不到能帮助我的解决方案。有人能告诉我问题出在哪里吗?
psql -U postgres
,接着输入create database project_name;
。如果操作成功,就把设置里的用户改为postgres。 - rishabsaraf93