DEV Community

Kalainithi sekar
Kalainithi sekar

Posted on

Day 16: Python Full Stack Development

Day 16 of learning Python Full Stack Development, Today the given task is to connect the database with FastAPI backend. I have connected existing FastAPI with PostgreSQL database and created database as smartbus and checking whether that FastAPI application can successfully connect to PostgreSQL. And also, I have created an two tables called "user" and "driver", the table consist of certain columns.

Next, I have created user APIs POST /users → (added new user into the user tables), GET /users → (Fetch the users from PostgreSQL and return them as JSON). Learnt CRUD, worked on ...to create and read data using FastAPI, using standard HTTP methods: @app.post() to create (write) data and @app.get() to read (retrieve) data. Running FastAPI application and opening Swagger to test: POST /users GET /users checking the data added through POST is stored in PostgreSQL and comes back through GET.
It was too difficult as beginner to do this... but side by side I have keep learning.

I may remember, involve me and I learn.

Top comments (0)