Flask Framework Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

Preface

In the five years since the first edition of this book was published, I have received numerous emails, letters, and feedback messages from readers appreciating or criticizing the book, and suggesting how it could be improved and updated. The technology itself has changed quite a bit in the meantime: Python 3 has taken the mainstream and Python 2 is on the path to being phased out. Flask released their first major version, version 1.0, in April 2018. Many libraries and packages became obsolete or unmaintained, while new libraries and packages evolved as substitutes or accessories. Alongside all this, a huge shift took place in application deployment and management architecture design, with scalability being the foremost concern.

For first-time readers, Flask is a lightweight web application microframework written in Python. It makes use of the flexibility of Python to provide a relatively simple template for web application development. Flask makes it possible to write simple one-page applications, but it also has the power to scale them and build larger applications without any issues.

Flask has excellent documentation and an active community. It has a number of extensions, each of which have documentation that can be rated from good to excellent. There are a few books available on Flask; they are great and provide a lot of insight into the framework and its applications. This book tries to take a different approach to explain the Flask framework and multiple aspects of its practical uses and applications as a whole.

This book takes you through a number of recipes that will help you understand the power of Flask and its extensions. You will start by exploring the different configurations that a Flask application can make use of. From here, you will learn how to work with templates, before learning about the ORM and view layers, which act as the foundation of web applications. Then, you will learn how to write RESTful APIs with Flask, after learning various authentication techniques. As you move ahead, you will learn how to write an admin interface, followed by debugging and logging errors in Flask. You will also learn how to make your applications multilingual and gain an insight into the various testing techniques. You will learn about the different deployment and post-deployment techniques on platforms such as Apache, Tornado, Heroku, and AWS Elastic Beanstalk. Finally, as an addition to this book's second edition, you will learn about popular microservices tools such as Docker, Kubernetes, and AWS Lambda that can be used to build highly scalable services.

By the end of this book, you will have all the information required to make the best use of this incredible microframework to write small and big applications and scale them with industry-standard practices.

A good amount of research coupled with years of experience have been used to develop this book, and I really hope that this book will benefit fellow developers.