2

I use this tutorial with Python 3.5, Django 1.9, Linux Mint and PostgreSQL 9.3. But when I try "manage.py migrate" I have an error:

django.db.utils.OperationalError: FATAL:  password authentication failed for user "myprojectuser"

My database settings:

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.postgresql_psycopg2',
    'NAME': 'myproject',
    'USER': 'myprojectuser',
    'PASSWORD': 'xxxxx',
    'HOST': 'localhost',
    'PORT': '',
}}
14
  • Is the password the correct one? Are you able to login in psql using the same credentials? Commented Dec 24, 2016 at 19:58
  • When I type "psql -d myproject -U myprojectuser" I have error: 'psql: FATAL: Peer authentication failed for user "myprojectuser"' Commented Dec 24, 2016 at 20:18
  • I think this askubuntu.com/questions/820792/… will solve your problem Commented Dec 24, 2016 at 20:26
  • Now I can login in psql using this username and password. But when I make 'manage.py migrate' I have the same error: password authentication failed for user "myprojectuser" Commented Dec 24, 2016 at 20:42
  • You can try with database url like: 'default': "postgres://myprojectuser:[email protected]:5432/myproject" Commented Dec 24, 2016 at 20:54

1 Answer 1

1

its fairly self-explanatory, are the database password setting and the postgres user setting equal?

open a terminal and sudo -i -u postgres psql then do alter user myprojectuser with encrypted password xxxxx; set password equal to the value of password in your settings dict

'default': {
'PASSWORD': 'xxxxx',
}
Sign up to request clarification or add additional context in comments.

1 Comment

its odd! I suggest you do a fresh start

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.