Password Authentication failed for user 'postgres' and default to windows user in PyCharm Professional

I have installed PostgreSQL on my windows PC. During installation I was asked a choose a password and a default user: postgres was assigned. I am trying to connect PostgreSQL to PyCharm for a Django project. I have changed my default database to PostgreSQL and tested the connection in the database. It worked perfectly. Below is the databases in the settings.py file.

DATABASES = {
'default': {
    'ENGINE': 'django.db.backends.postgresql',
    'NAME': 'btredb@localhost',
    'USER': 'postgres',
    'PASSWORD': 'PG_PASSWORD',
    'HOST': '127.0.0.1',
    'PORT': '5432',

}

}

However, when I run manage.py runserver I get a password authentication failed for use 'cheap' which is my windows user. Why is PyCharm trying login to the windows user instead of the PostgreSQL user set in the databases settings? Can any one help to connect PostgreSQL to PyCharm professional?

Back to Top