Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Mastering Flask
  • Table Of Contents Toc
Mastering Flask

Mastering Flask

By : Jack Stouffer
3.6 (25)
close
close
Mastering Flask

Mastering Flask

3.6 (25)
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 (15 chapters)
close
close
14
Index

Preface

Flask is a web framework for Python that is specifically designed to provide the minimum amount of functionality that is needed to create web apps. Unlike other web frameworks, especially those in other languages, Flask does not have an entire ecosystem of libraries bundled with it for things such as database querying or form handling. Flask instead prefers to be an implementation agnostic.

The main feature of this setup is that it allows the programmer to design their app and their tools in any way they want. Not providing their own version of common abstractions also means that the standard library can be used much more often than other frameworks, which guarantees their stability and readability by other Python programmers. Because the Flask community is rather large, there are also many different community-provided ways of adding common functionality. One of the main focuses of this book is to introduce these extensions and find out how they can help avoid reinventing the wheel. The best part about these extensions is that if you don't need their extra functionality, you don't need to include them and your app will stay small.

The main downside of this setup is that the vast majority of new Flask users do not know how to properly structure large applications and end up creating an unintelligible and unmaintainable mess of code. This is why the other main focus of this book is how to create a Model View Controller (MVC) architecture with Flask apps.

Originally invented to design desktop user interfaces, the MVC setup allows the data handling (models), user interaction (controllers), and user interface (views) to be separated into three different components.

Preface

Separating these three different components allows the programmer to reuse code rather than re-implement the same functionality for each web page. For example, if the data handling code wasn't split into its own separate functions, we would have to write the same database connection code and SQL queries in each of the functions that render a web page.

A large amount of research and a lot of painful first-hand experience of what can go wrong while developing web applications has made this book the most comprehensive resource on Flask available, so I sincerely hope that you will enjoy reading it.

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Mastering Flask
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon