Build a CRUD Rest API in Python using Flask, Postgres, Docker and Docker compose #python #docker

preview_player
Показать описание
In this Live episode, I will create a set of CRUD Rest API, using Flask, SQLAlchemy Postgres as a Database, Docker and Docker Compose.

2:40 app file: Flask app, SQLAlchemy app, Model, test route
6:15: routes and CRUD controllers: Create, Read, Update, Delete
12:04 Dockerize the Flask application. Dockerfile
18:00 Test Postgres container. test with Tableplus
19:45 Build the image (debug) and run the app service. Test endpoints
23:53 Bug fixing. Final test

#python #flask #sqlalchemy #postgres #docker #dockercompose #api #restapi
Рекомендации по теме
Комментарии
Автор

Excellent tutorial, was a total beginner and now I created the Python Flask web application and Dockerized in less than 30 mins.

ibiawosanya
Автор

A 29-minute video took me two days of study because I had never configured Docker on WSL before. I needed to learn the basics of Flask, Docker, and Postgres to successfully follow the tutorial. The content was amazing, and I managed to complete everything, although with some modifications. The assistance from ChatGPT was crucial in understanding concepts and commands, making the process more easier. Ty boss

matheusmagalhaes
Автор

0:00 Intro. Architecture and project setup. Dependencies in requirements.txt
2:40 app file: Flask app, SQLAlchemy app, Model, test route
6:15: routes and CRUD controllers: Create, Read, Update, Delete
12:04 Dockerize the Flask application. Dockerfile
14:08 docker-compose.yml: flask app and Postgres services
18:00 Test Postgres container. test with Tableplus
19:45 Build the image (debug) and run the app service. Test endpoints
23:53 Bug fixing. Final test

francescociulla
Автор

Is code suggestions being suggested by an extension?
Is there a similiar co-pilot in pycharm?

TheIaTaI
Автор

When I run "docker compose up --build flask_app" I received the message:
RuntimeError: Working outside of application context.
This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.

Any suggestions to resolve this? Sorry, I'm beginner

mrjmrezende
Автор

My friend, you can use command "docker compose logs -f" for debugging

zaki
Автор

API's all the endpoints are working fine, After containerizing it using docker the Database is created as per Table Plus. Test endpoint of the application is working fine. But I am getting error that no table exists. I tried multiple solutions from internet and chatgpt. Please help

GauravSingh-uijr
Автор

Why did the API return HTML to Postman when you encountered the error? Shouldn't it have returned your generic JSON error message?

michaeloneill
Автор

good video, if i want to create 2 container, one for DB and other for the API, how can i process?

koudjoura
Автор

Why i can't connect to db in postgres, i get this error from table plus:
connection to server at "localhost" (::1), port 5432 failed: FATAL: la autentificaci�n password fall� para el usuario �postgres�

I did everything the same until I reached the command: docker compose up -d flask_db

help please.

fargatepb-tbrl
Автор

I'm unable to create users. Help me.

susmitadey