Connecting to a PostgreSQL DB on CloudSQL via Python server running on Cloud Run
29 Jan, 2025
Once we have our PostgreSQL database running on CloudSQL, with the flag cloudsql.iam_authentication set to on. We can now have a look at how we could create a Python FastAPI backend that connects to the database.
Let's start by creating a project folder and Python environment.
mkdir cloudsql-pg-connector
cd cloudsql-pg-connector
python3 -m venv env
source env/bin/activate
We now have our project ready for the installation of packages and coding.
Hey there! 👋 I love sharing my coding journey, insights, and tutorials to help fellow developers grow. If you've found my content valuable, consider supporting my work! Your contributions help me keep creating quality content, explore new topics, and share more useful resources with the community. Thanks for your support! ❤️
Write a comment ...