Open nirgn975 opened 4 years ago
You need to use python-dotenv (pipenv install python-dotenv
) and add the .env
file to .gitignore
.
Read this: https://12factor.net
First stage: Add the environment variables to kubernetes. You need to create the Cloud SQL, and upload to the cloud and check that everything is working now.
Second stage: Delete them from the environment variables and add them to kubernetes secret.
Create a PostgreSQL database as a SASS on GCP (Cloud SQL).
Make sure to insert the
username
andpassword
andhost
as an environment variables. After that, query a new endpoint with insomnia:This is a
POST
request - which we usually use to create something on the internet, in our case we create a "person" and insert it to the database. After that, you can query the same endpoint but with theGET
method to get all the people from the database.FYI There is pretty big list of HTTP methods that we use for different things, but the most common ones are:
GET
to retrieve some data.POST
to create some data.PUT
to edit data.DELETE
to delete data.