OperationalError at /admin/
FATAL: Peer authentication failed for user "myuser"
This is the error I am receiving when I try to get to my Django admin site. I had been using MySQL database no problem. I am new to PostgreSQL, but decided to switch because the host I ultimately plan to use for this project does not have MySQL.
Therefore, I figured I could go through the process of installing PostgreSQL, run a syncdb and be all set.
Problem is that I cannot seem to get my app to connect to the database. I can login to PostgreSQL via command line or desktop app that I downloaded. Just not in the script.
Also, I can use manage.py shell to access the db just fine.
Any thoughts?
I took a peek at the exception, noticed it had to do with my connection settings. Went back to settings.py, and saw I did not have a Host setup. Add
localhostand voila.My settings.py did not have a HOST for MySQL database, but I needed to add one for PostgreSQL to work.
In my case, I added
localhostto theHOSTsetting and it worked.Here is the
DATABASESsection from mysettings.py.