I can not figure out what is going wrong here.
I have developed a Python/Flask web app using pure psycopg2. initially using a local instance of Postgres, then I started a Postgres Cloud SQL on google and connected to that using
conn = psycopg2.connect(database="********", user = "********", password = "**********", host = "104.***.***.**", port = "5432")
Now I need to deploy the app but from what I understand from the documentation, I can't just use the IP. However the documentation example is all based on SQLAlchamy which I have not used before and prefer not to rewrite my app in it.
from what I understand, Cloud SQL loads the instance in a proxy based on the entry in app.yaml specifying the instance. it does so in a. unix socket. so I tried
conn = psycopg2.connect(database="********", user = "********", password = "**********", host = "/cloudsql/[my instance name here]")
I tried the cloud console, and used the development proxy there loaded to a unix socket and previewed the app and it seemed to work just fine. but when I deployed this working version. it still wouldn't connect to the database.
So what am I doing wrong here