DATABASE_URL = "postgresql://myusername:mypassword@localhost/postgres"
This line seems weird.
If myusername and mypassword are variable,you should use format-string like below
DATABASE_URL = f"postgresql://{myusername}:{mypassword}@localhost/postgres"
Hope it works.