Dear instructor,
I am working on a MAC machine and after writing all the code till lecture number 22. I am getting connection to the db Failed error.
Please refer the GitHub Repo and screenshot given for the clarification.
Hi Kapil,
The error says that the "role does not exist" which means the POSTGRES_USER specified in core > config.py file is None.
There could be several reasons for this.
1. POSTGRES_USER might not be specified in your .env file.
2. There could be a spelling mistake for POSTGRES_USER in the .env file or config.py file.
3. There could be a spelling mistake in the DATABASE_URL line.
My suggestion would be to try to print the values of POSTGRES_USER and DATABASE_URL and manually check if the role is being displayed.
I am attaching a screenshot below for the process.
Brige the gap between Tutorial hell and Industry. We want to bring in the culture of Clean Code, Test Driven Development.
We know, we might make it hard for you but definitely worth the efforts.
© Copyright 2022-23 Team FastAPITutorial