Kick off your book project in 3 hours! Live workshop on Zoom. You’ll leave with a real book project, progress on your first chapter, and a clear plan to keep going. Saturday, May 2, 2026. Learn more…

Leanpub Header

Skip to main content

Flask and Python Web From Zero to Advanced: REST APIs, Admin Panel and Real-Time Chat

Build professional applications with Flask, SQLAlchemy, Jinja2, Bootstrap, Vue, Flask-Login, JWT, Socket.IO, billing, user roles, and automated testing.

Flask is a great web framework for creating server-side web applications with Python; If you don't have knowledge of using server web frameworks with Python, Flask is a good candidate to start with. This book is mostly practical, we will learn the basics of Flask, knowing its main features.

This book is a translation into English of Flask y Python Web Desde Cero a Avanzado: APIs REST, Panel Admin y Chat en Tiempo Real which was originally written in Spanish

Minimum price

$10.00

$20.00

You pay

$20.00

Author earns

$16.00
$
You can also buy this book with 1 book credit. Get book credits with a Reader Membership or an Organization Membership for your team.
PDF
EPUB
About

About

About the Book

Flask is a great web framework for creating server-side web applications with Python; if you do not have knowledge of using server web frameworks with Python, Flask is a good candidate to start with; being a microframework, which means that initially it comes with the minimum necessary to be able to function.

This book consists of 27 chapters, with which we will learn in detail the most important and basic features of Flask:

Chapter 1 - Required software and tools installation: In this chapter we are going to present the software necessary to create projects in Flask, what happens from Python, to preparing the environment, the editor that we will use, VSC and a web browser.

Chapter 2 - Introduction to Python: In this chapter we will give an introduction to Python, knowing its basic characteristics and functionalities such as variables, data types, functions, classes, among others.

Chapter 3 - Introduction to Flask: We present some essential commands to develop in Flask, we will prepare the environment and give an introduction to the framework, we will create a structure for the project in Flask and we will get a basic understanding of the routing for the controllers.

Chapter 4 - Template in Flask with Jinja: In this chapter we will see how to use the template engine par excellence in Flask, which is Jinja, with which we can return responses in HTML format and customize the page with embedded Python code with which we can customize using blocks, filters, macros, among others.

Chapter 5 - Database - SQLAlchemy: In this chapter we will see how to connect an application in Flask to a relational database such as MySQL using SQLAlchemy; We will see how to configure a database, connection through the models, generation of automatic migrations based on the models and basic CRUD operations to manipulate the database.

Chapter 6 - Flask-Migrate: In this chapter we will install the Flask Migrate extension to configure a migration system for the project and in this way be able to customize the tables and have a robust schema to be able to make changes to the database in a practical and scalable way, in addition to be able to create a trace with these changes.

Chapter 7 - Forms: In this chapter we will use the Form WTF extension to create forms, apply validations, initial values and later dump this data into the database, these forms are classes with the aforementioned attributes and in this way we can apply the same schema for server and client side data manipulation.

Chapter 8 - Relations: In this chapter we will see how to use one-to-one, one-to-many and many-to-many relationships in Flask with SQLAlchemy.

Chapter 9 - Flash messages and session: In this chapter we will see how to use flash messages useful to inform the user about the operations carried out.

Chapter 10 - Authentication: In this chapter we will use Flask Login to create an authentication system and protect drivers.

Chapter 11 - Rest API: In this chapter we will see how to implement a Rest Api using the Restful Flash package, generate access tokens and make test connections.

Chapter 12 - Unit tests: In this chapter we will see how to implement unit tests that are part of the development of any application. To do this, we will use the Pytest package available for Python.

Chapter 13 - Static files: In this chapter we will integrate the Bootstrap 5 web framework to our project in Flask, in this way, we will see how to use both technologies together and we will apply styles to the forms, lists, navigation menu, among others.

Chapter 14 - Locale and translations: In this chapter we will use Flask Babel to add a multilanguage system to the application, to give the application the ability to use more than one language.

Chapter 15 - Extensions: Are you using outdated packages in Flask? Discover which extensions to avoid in 2026 and what modern alternatives will help you scale your projects safely.

Chapter 16 - Custom decorators: In this chapter we will learn how to create custom decorators to use in controllers.

Chapter 17 - Roles and User Profile: In this chapter we will integrate a role system into the application, in addition to this, we will enhance the user profile with several options such as the option to change the password, social networks, address, preferred language, among others.

Chapter 18 - Data manipulation and tests: In this chapter we are going to learn about some operations on the database using SQLAlchemy, in addition to knowing how to use the Flask shell.

Chapter 19 - Environment variables: In this chapter we are going to learn how to use files to manage environment variables in Flask.

Chapter 20 - Create a filter with forms: In this chapter we are going to create our first experiment which will be a filter to filter by search term, category and tag.

Chapter 21 - Deployement: We will see how we can deploy the project to the Railway service.

Chapter 22 - Real-Time Application Creation: The Power of Flask and Socket.IO: Learn to build real-time applications with Flask and Socket.IO. Complete step-by-step guide: from environment and WebSocket setup to room management, user authentication with Flask-Login, and database persistence with a modern Bootstrap 5 design.

Chapter 23 - General Aspects: We'll look at some general aspects of Flask that we haven't been able to introduce before, such as using Celery to process asynchronous tasks and programming in the age of AI.

Chapter 24 - Project: Enhancing the administrator module: In this chapter, we'll implement a robust authentication and authorization system using Flask Security Too. You'll learn how to replace custom logic to integrate complete login, registration, and email confirmation flows. We'll also design an advanced role system with many-to-many relationships and customize security templates to match our branding.

Chapter 25 - Create a simple billing system: Develop a complete billing system in Flask using asynchronous JavaScript, JSON data serialization, and PDF receipt generation with pdfkit.

Chapter 26 - Consuming a REST API in Vue 3: We will see how to consume a REST API in Flask from Vue.

Chapter 27 - MongoDB: A complete guide to mastering MongoDB and Flask. Develop secure web applications, integrate MongoEngine to manage relationships, build REST APIs, and master Flask-JWT-Extended.

Share this book

Categories

This book is a translation into English of Flask y Python Web Desde Cero a Avanzado: APIs REST, Panel Admin y Chat en Tiempo Real which was originally written in Spanish

Author

About the Author

Andrés Cruz Yoris

Andrés Cruz Yoris, Licenciado en Computación, con más de 10 años de experiencia en el desarrollo de aplicaciones web en general; trabajo con PHP, Python y tecnologías del lado del cliente como HTML, JavaScript, CSS, Vue entre otras; y del lado del servidor como Laravel, Flask, Django y Codeigniter. También desarrollo con Android Studio, xCode y Flutter para la creación de aplicaciones nativas para Android e IOS.

Pongo a tú disposición parte de mi aprendizaje, reflejado en cada una de las palabras que componen mis libros sobre el desarrollo de aplicaciones en general.

Translations

Translations

Languages

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $15 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub