Skip to main content

Posts

Showing posts with the label SQLAlchemy

FastAPI Tutorial for Beginners: Build a Complete CRUD App From Scratch

Most of my channel is Java and Spring Boot. For this video I wanted a break, so I built something in Python that a complete beginner can finish in one sitting: a to-do app with a real REST API, a real database and a web page on top. It comes to three files and under 130 lines of Python. This post is the written companion to the video. Every code block below is copied from the project, and I ran every request in it against that code before publishing. If you prefer to read, you can build the whole thing from this page. If you prefer to watch, the video is right here. What you'll build A to-do list where you can add a task, tick it off, rename it and delete it. The page talks to an API you write yourself, and the API saves everything in a database, so your tasks are still there after a restart. FastAPI also gives you a free interactive docs page at /docs where you can test every endpoint from the browser. File Its one job index.html The to-do page, styled with Bootstrap. I...

FastAPI Tutorial for Beginners: Build a Complete CRUD App From Scratch

Most of my channel is Java and Spring Boot. For this video I wanted a break, so I built something in Python that a complete beginner can finish in one sitting: a to-do app with a real REST API, a real database and a web page on top. It comes to three files and under 130 lines of Python. This post is the written companion to the video. Every code block below is copied from the project, and I ran every request in it against that code before publishing. If you prefer to read, you can build the whole thing from this page. If you prefer to watch, the video is right here. What you'll build A to-do list where you can add a task, tick it off, rename it and delete it. The page talks to an API you write yourself, and the API saves everything in a database, so your tasks are still there after a restart. FastAPI also gives you a free interactive docs page at /docs where you can test every endpoint from the browser. File Its one job index.html The to-do page, styled with Bootstrap. I...