Book Image

Mastering Flask

By : Jack Stouffer
Book Image

Mastering Flask

By: Jack Stouffer

Overview of this book

Starting from a simple Flask app, this book will walk through advanced topics while providing practical examples of the lessons learned. After building a simple Flask app, a proper app structure is demonstrated by transforming the app to use a Model-View-Controller (MVC) architecture. With a scalable structure in hand, the next chapters use Flask extensions to provide extra functionality to the app, including user login and registration, NoSQL querying, a REST API, an admin interface, and more. Next, you’ll discover how to use unit testing to take the guesswork away from making sure the code is performing as it should. The book closes with a discussion of the different platforms that are available to deploy a Flask app on, the pros and cons of each one, and how to deploy on each one.
Table of Contents (20 chapters)
Mastering Flask
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 1. Getting Started

Python is a flexible language that gives programmers the freedom to structure their programming environment. However, a dangerous consequence of this freedom is the ability to not set up a new Python project right from the beginning in order to avoid problems down the road.

For example, you could be halfway through your project and realize that you deleted a file or piece of code five days ago that you need to use now. Consider another example where two of the packages that you wish to use require different versions of the same underlying package. Other than the tools introduced in this chapter, there will be a lot of extra work fixing problems that already have solutions. A little extra work in the beginning can save days of work in the future.

To this end, we will need to install three programs: Git, pip, and virtualenv.