Book description
Over 80 hands-on recipes to help you create small-to-large web applications using Flask
In Detail
Flask Framework Cookbook takes you through a number of recipes that will help you understand the power of Flask and its extensions. You will start by seeing the different ways of configurations that a Flask application can make use of. You will learn how to work with templates and learn about the ORM and view layers. You will see how to write an admin interface followed by the debugging and logging of errors. Finally, you will learn about different deployment and post-deployment techniques on platforms such as Apache, Tornado, and Heroku.
By the end of this book, you will have gained all the knowledge required to write Flask applications in the best possible way, and scale them with best practices.
What You Will Learn
- Configure Flask in the best way to suit your application needs
- Integrate Flask with technologies such as Redis, Sentry, and MongoDB
- Integrate your applications with most of the login mechanisms available
- Write beautiful RESTful applications
- Create an admin interface for your application
- Learn about efficient and effective debugging, logging, and error handling in Flask
- Test your applications as you write them to prevent future complications
- Implement full-text search for effective user query handling
Table of contents
-
Flask Framework Cookbook
- Table of Contents
- Flask Framework Cookbook
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Preface
- 1. Flask Configurations
- 2. Templating with Jinja2
- 3. Data Modeling in Flask
-
4. Working with Views
- Introduction
- Writing function-based views and URL routes
- Class-based views
- URL routing and product-based pagination
- Rendering to templates
- Dealing with XHR requests
- Decorator to handle requests beautifully
- Creating custom 404 and 500 handlers
- Flashing messages for better user feedback
- SQL-based searching
- 5. Webforms with WTForms
- 6. Authenticating in Flask
- 7. RESTful API Building
- 8. Admin Interface for Flask Apps
- 9. Internationalization and Localization
-
10. Debugging, Error Handling, and Testing
- Introduction
- Setting up basic file logging
- Sending e-mails on the occurrence of errors
- Using Sentry to monitor exceptions
- Debugging with pdb
- Creating our first simple test
- Writing more tests for views and logic
- Nose library integration
- Using mocking to avoid real API access
- Determining test coverage
- Using profiling to find bottlenecks
-
11. Deployment and Post Deployment
- Introduction
- Deploying with Apache
- Deploying with uWSGI and Nginx
- Deploying with Gunicorn and Supervisor
- Deploying with Tornado
- Using Fabric for deployment
- S3 storage for file uploads
- Deploying with Heroku
- Deploying with AWS Elastic Beanstalk
- Application monitoring with Pingdom
- Application performance management and monitoring with New Relic
- 12. Other Tips and Tricks
- Index
Product information
- Title: Flask Framework Cookbook
- Author(s):
- Release date: November 2014
- Publisher(s): Packt Publishing
- ISBN: 9781783983407
You might also like
book
Flask Framework Cookbook - Second Edition
Build state-of-the-art web applications quickly and efficiently using Flask and related technologies with Python 3 Key …
book
Learning Flask Framework
Build dynamic, data-driven websites and modern web applications with Flask About This Book Discover the most …
book
Flask Web Development
Take full creative control of your web applications with Flask, the Python-based microframework. With this hands-on …
book
Flask By Example
Unleash the full potential of the Flask web framework by creating simple yet powerful web applications …