I am trying to migrate a DB from sqlite to postgresql...so I typed:
sudo -u postgres psql
postgres=# ALTER USER postgres WITH PASSWORD 'newpassword';
and the output returns ALTER ROLE
but when I type python manage.py migrate
I receive always the same error:
django.db.utils.OperationalError: FATAL: password authentication failed for user "douglas"
This is the database sections of my settings.py.
# Old, using mysqlite
"""
DATABASES = {
#'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
#}
'default': dj_database_url.config(default='postgres://localhost:5432/postgres_db_name'),
}
"""
# New, using postgres
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'douglas_db',
'USER': 'douglas',
'PASSWORD': 'vamointer',
'HOST': '127.0.0.1',
'PORT': '5432',
}
}
Note: When I run the 'ALTER USER postgres WITH PASSWORD' I put in the same password defined in the settings.py.