Type Here to Get Search Results !

Flask Web Development by Miguel Grinberg in pdf


Download this PDF book: Flask Web Development: Developing Web Applications with Python 2nd Edition by Miguel Grinberg

Take full creative control of your web applications with Flask, the Python-based microframework. With the second edition of this hands-on book, you’ll learn Flask from the ground up by developing a complete, real-world application created by author Miguel Grinberg. This refreshed edition accounts for important technology changes that have occurred in the past three years.

Explore the framework’s core functionality, and learn how to extend applications with advanced web techniques such as database migrations and an application programming interface. The first part of each chapter provides you with reference and background for the topic in question, while the second part guides you through a hands-on implementation.

If you have Python experience, you’re ready to take advantage of the creative freedom Flask provides. Three sections include:

A thorough introduction to Flask: explore web application development basics with Flask and an application structure appropriate for medium and large applications

Building Flasky: learn how to build an open source blogging application step-by-step by reusing templates, paginating item lists, and working with rich text

Going the last mile: dive into unit testing strategies, performance analysis techniques, and deployment options for your Flask application

Flask stands out from other frameworks because it lets developers take the driver’s seat and have full creative control of their applications. Maybe you have heard the phrase “fighting the framework” before. 

This happens with most frameworks when you decide to solve a problem with a solution that isn’t the official one. It could be that you want to use a different database engine, or maybe a different method of authenticating users. Deviating from the path set by the framework’s developers will give you lots of headaches.

Flask is not like that. Do you like relational databases? Great. Flask supports them all. Maybe you prefer a NoSQL database? No problem at all. Flask works with them too. Want to use your own homegrown database engine? Don’t need a database at all? Still fine. With Flask you can choose the components of your application, or even write your own if that’s what you want. No questions asked!

The key to this freedom is that Flask was designed from the start to be extended. It comes with a robust core that includes the basic functionality that all web applications need and expects the rest to be provided by some of the many third-party extensions in the ecosystem—and, of course, by you.

In this book I present my workflow for developing web applications with Flask. I don’t claim this to be the only true way to build applications with this framework. You should take my choices as recommendations and not as gospel.

Most software development books provide small and focused code examples that demonstrate the different features of the target technology in isolation, leaving the “glue” code that is necessary to transform these different features into a fully working application to be figured out by the reader. 

I take a completely different approach. All the examples I present are part of a single application that starts out very simple and is expanded in each successive chapter. This application begins life with just a few lines of code and ends as a nicely featured blogging and social networking application.

Lask is a small framework by most standards—small enough to be called a “micro framework,” and small enough that once you become familiar with it, you will likely be able to read and understand all of its source code. 

But being small does not mean that it does less than other frameworks. Flask was designed as an extensible framework from the ground up; it provides a solid core with the basic services, while extensions provide the rest. 

Because you can pick and choose the extension packages that you want, you end up with a lean stack that has no bloat and does exactly what you need. Flask has three main dependencies. The routing, debugging, and Web Server Gateway Interface (WSGI) subsystems come from Werkzeug; the template support is provided by Jinja2; and the command-line integration comes from Click. 

These dependencies are all authored by Armin Ronacher, the author of Flask. Flask has no native support for accessing databases, validating web forms, authenti‐ cating users, or other high-level tasks. These and many other key services most web applications need are available through extensions that integrate with the core pack‐ ages. 

As a developer, you have the power to cherry-pick the extensions that work best for your project, or even write your own if you feel inclined to. This is in contrast with a larger framework, where most choices have been made for you and are hard or sometimes impossible to change. In this chapter, you will learn how to install Flask. The only requirement is a com‐ puter with Python installed.

Who This Book Is For

You should have some level of Python coding experience to make the most of this book. Although the book assumes no previous Flask knowledge, Python concepts such as packages, modules, functions, decorators, and object-oriented programming are assumed to be well understood. Some familiarity with exceptions and diagnosing issues from stack traces will be very useful.

While working through the examples in this book, you will spend a great deal of time in the command line. You should feel comfortable using the command line of your operating system.

Modern web applications cannot avoid the use of HTML, CSS, and JavaScript. The example application that is developed throughout the book obviously makes use of these, but the book itself does not go into a lot of detail regarding these technologies and how they are used. 

Some degree of familiarity with these languages is recommended if you intend to develop complete applications without the help of a developer versed in client-side techniques.

I released the companion application to this book as open source on GitHub. Although GitHub makes it possible to download applications as regular ZIP or TAR files, I strongly recommend that you install a Git client and familiarize yourself with source code version control (at least with the basic commands to clone and check out the different versions of the application directly from the repository). 

The short list of commands that you’ll need is shown in “How to Work with the Example Code”. You will want to use version control for your own projects as well, so use this book as an excuse to learn Git!

About the Author

Miguel Grinberg has over 25 years of experience as a software engineer. He blogs at blog/miguelgrinberg/com about a variety of topics including web development, robotics, photography, and the occasional movie review. Miguel lives in Portland, Oregon.

Table of Contents:

Part I. Introduction to Flask

1. Installation

2. Basic Application Structure

3. Templates

4. Web Forms

5. Databases

6. Email

7. Large Application Structure

Part II. Example: A Social Blogging Application

8. User Authentication

9. User Roles

11. Blog Posts


13. User Comments

14. Application Programming Interfaces

Part III. The Last Mile

15. Testing

16. Performance

17. Deployment

18. Additional Resources

About the book:

Publisher ‏ : ‎ O'Reilly Media; 2nd edition (April 10, 2018)

Language ‏ : ‎ English

Pages ‏ : ‎ 316 

File : PDF, 6MB 


Free Download the Book: Flask Web Development: Developing Web Applications with Python 2nd Edition by Miguel Grinberg

PS: Share the link with your friends

If the Download link is not working, kindly drop a comment below, so we'll update the download link for you.

Happy downloading!

Post a Comment

* Please Don't Spam Here. All the Comments are Reviewed by Admin.