Getting started with Flask: Here you continue your journey in developing web applications in Python with Flask

Andres Cruz
Ebook
278
Pages
Eligible

About this ebook

This guide is intended to take your first steps with Flask using Python; with this, we are going to propose two things:

It is not a book that aims to know Flask 100%, or from zero to expert, since it would be too big an objective for the scope of this guide, otherwise, to know what it offers us and create the first web applications with Flask , know its extensions, create an API, use Jinja2 among others...

It is assumed that the reader has at least basic knowledge of Python development.

This book has a practical approach, knowing the key aspects of the technology and moving into practice, gradually implementing small features of an application that has real scope.

To follow this book you need to have a computer with Windows, Linux or MacOS.

The book is currently in development.


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

Chapter 1: 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 2: 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 3: 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: 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: 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: 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: 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: 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: In this chapter we will see how to use flash messages useful to inform the user about the operations carried out.


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


Chapter 11: 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: 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: 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: 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: In this chapter we will learn about several Flask extensions that we have not used until this chapter, such as cache, CLI, a debug banner, email, among others.


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


Chapter 17: 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: 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: In this chapter we are going to learn how to use files to manage environment variables in Flask.


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

About the author

This book was prepared by Andrés Cruz Yoris, Graduate in Computing, with more than 10 years of experience in the development of web applications in general; I work with PHP, Python and client-side technologies such as HTML, JavaScript, CSS, Vue among others and server-side technologies such as Laravel, Flask, Django and CodeIgniter. I am also a developer in Android Studio, xCode and Flutter for creating native applications for Android and IOS.

I put at your disposal part of my learning, reflected in each of the words that make up this book, my fifteenth book on software development, but the third focused on Python, for the development of web applications with Flask

Rate this ebook

Tell us what you think.

Reading information

Smartphones and tablets
Install the Google Play Books app for Android and iPad/iPhone. It syncs automatically with your account and allows you to read online or offline wherever you are.
Laptops and computers
You can listen to audiobooks purchased on Google Play using your computer's web browser.
eReaders and other devices
To read on e-ink devices like Kobo eReaders, you'll need to download a file and transfer it to your device. Follow the detailed Help Center instructions to transfer the files to supported eReaders.