Question

FATAL: password authentication failed for user "myprojectdbuser"

I’m getting an operational errror in a section of my website FATAL: password authentication failed for user “myprojectdbuser” Request Method: GET Request URL: http://178.62.41.209/blog/ Django Version: 1.8.7 Exception Type: OperationalError Exception Value:

FATAL: password authentication failed for user “myprojectdbuser” FATAL: password authentication failed for user “myprojectdbuser”

Exception Location: /usr/lib/python2.7/dist-packages/psycopg2/init.py in connect, line 164 Python Executable: /usr/bin/python Python Version: 2.7.12 Python Path:

[‘/home/django/django_project’, ‘/home/django/django_project’, ‘/usr/bin’, ‘/usr/lib/python2.7’, ‘/usr/lib/python2.7/plat-x86_64-linux-gnu’, ‘/usr/lib/python2.7/lib-tk’, ‘/usr/lib/python2.7/lib-old’, ‘/usr/lib/python2.7/lib-dynload’, ‘/usr/local/lib/python2.7/dist-packages’, ‘/usr/lib/python2.7/dist-packages’]

Server time: Fri, 12 Jan 2018 08:40:01 +0000

Error during template rendering

In template /home/django/django_project/blog/templates/blog/blog.html, error at line 3 FATAL: password authentication failed for user “myprojectdbuser” FATAL: password authentication failed for user “myprojectdbuser” 1 {% extends “personal/header.html” %} 2 {% block content %} 3

  {% for post in object_list %}

4 <h5>{{ post.date|date:“Y-m-d” }}<a href=“/blog/{{post.id}}”> {{ post.title }}</a></h5> 5 {% endfor %} 6 {% endblock %} 7

This might be due to the superuser but when I try to create a superuser on the server I get the authentication failed error.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello,

It looks like either your database user password is incorrect, or the username itself is not correct.

You would need to follow the steps here on how to create a Postgres user for your Django app:

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04#create-the-postgresql-database-and-user

Best,

Bobby