python 管理.py 同步数据库
我对 python 和 Django 非常陌生,自从我们的编码员去了海外后,我实际上是为了完成我公司的一些编码而被投入的。
当我运行 python manage.pysyncdb 时,收到以下错误
psycopg2.OperationalError: FATAL: user "winepad" 密码身份验证失败
我不确定为什么系统会提示我输入用户“winepad”,因为我没有创建这样的用户通过这个名字,我正在从名为 winepad 的文件夹运行同步。在我的 pg_hba.conf 文件中,我只有一个 postgres 帐户,我用新密码更改了该帐户。
任何帮助将不胜感激,因为我留下的说明给我带来了一些问题。
先感谢您
I am very new to python and Django, was actually thrown in to finish off some coding for my company since our coder left for overseas.
When I run python manage.py syncdb I receive the following error
psycopg2.OperationalError: FATAL: password authentication failed for user "winepad"
I'm not sure why I am being prompted for user "winepad" as I've created no such user by that name, I am running the sync from a folder named winepad. In my pg_hba.conf file all I have is a postgres account which I altered with a new password.
Any help would be greatly appreciated as the instructions I left are causing me some issues.
Thank you in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
启动 Django 项目后,您必须在
your_project/settings.py
中设置数据库设置。您想要检查/更改的设置是(假设您使用 Django 1.3)如下所示:因此,请确保这些设置正确设置(您必须手动执行)
Once you start a Django project, you have to set your database settings in
your_project/settings.py
. The settings you want to check/change is (assuming you use Django 1.3) something like this:So make sure those settings are correctly set up (you have to do it manually)
检查您的 settings.py 文件。此问题最可能的原因是数据库的用户名设置为“winepad”。将其更改为适当的值并重新运行 python manage.pysyncdb 这应该可以解决问题。
Check your settings.py file. The most likely reason for this issue is that the username for the database is set to "winepad". Change that to the appropriate value and rerun
python manage.py syncdb
That should fix the issue.