Flask Framework Cookbook
eBook - ePub

Flask Framework Cookbook

  1. 258 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Flask Framework Cookbook

Book details
Book preview
Table of contents
Citations

About This Book

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.

Frequently asked questions

Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Flask Framework Cookbook by Shalabh Aggarwal in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in Python. We have over one million books available in our catalogue for you to explore.

Information

Year
2014
ISBN
9781783983407
Edition
1

Flask Framework Cookbook


Table of Contents

Flask Framework Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Flask Configurations
Introduction
Environment setup with virtualenv
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Handling basic configurations
Getting ready
How to do itā€¦
How it worksā€¦
Class-based settings
How to do itā€¦
How it worksā€¦
Organization of static files
How to do itā€¦
How it worksā€¦
There's moreā€¦
Being deployment specific with instance folders
How to do itā€¦
How it worksā€¦
Composition of views and models
How to do itā€¦
How it worksā€¦
See also
Creating a modular web app with blueprints
Getting ready
How to do itā€¦
How it worksā€¦
See also
Making a Flask app installable using setuptools
How to do itā€¦
How it worksā€¦
See also
2. Templating with Jinja2
Introduction
Bootstrap layout
Getting ready
How to do itā€¦
How it worksā€¦
See also
Block composition and layout inheritance
Getting ready
How to do itā€¦
How it worksā€¦
See also
Creating a custom context processor
How to do itā€¦
See also
Creating a custom Jinja2 filter
How to do itā€¦
How it worksā€¦
See also
Creating a custom macro for forms
Getting ready
How to do itā€¦
Advanced date and time formatting
Getting ready
How to do itā€¦
See more
3. Data Modeling in Flask
Introduction
Creating a SQLAlchemy DB instance
Getting ready
How to do itā€¦
There's moreā€¦
See also
Creating a basic product model
How to do itā€¦
How it worksā€¦
See also
Creating a relational category model
How to do itā€¦
See also
Database migration using Alembic and Flask-Migrate
Getting ready
How to do itā€¦
How it worksā€¦
See also
Model data indexing with Redis
Getting ready
How to do itā€¦
How it worksā€¦
Opting the NoSQL way with MongoDB
Getting ready
How to do itā€¦
See also
4. Working with Views
Introduction
Writing function-based views and URL routes
Getting ready
How to do itā€¦
A simple GET request
A simple POST request
A simple GET/POST request
How it worksā€¦
There's moreā€¦
Class-based views
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
URL routing and product-based pagination
Getting ready
How to do itā€¦
Adding pagination to applications
See also
Rendering to templates
Getting ready
How to do itā€¦
How it worksā€¦
See also
Dealing with XHR requests
Getting ready
How to do itā€¦
How it worksā€¦
Decorator to handle requests beautifully
Getting ready
How to do itā€¦
See also
Creating custom 404 and 500 handlers
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Flashing messages for better user feedback
Getting ready
How to do itā€¦
How it worksā€¦
SQL-based searching
Getting ready
How to do itā€¦
How it worksā€¦
5. Webforms with WTForms
Introduction
SQLAlchemy model data as form representation
Getting ready
How to do itā€¦
How it worksā€¦
See also
Validating fields on the server side
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Creating a common forms set
How to do itā€¦
How it worksā€¦
Creating custom fields and validation
How to do itā€¦
How it worksā€¦
There's moreā€¦
Creating a custom widget
How to do itā€¦
How it worksā€¦
See also
Uploading files via forms
How to do itā€¦
How it worksā€¦
Cross-site Request Forgery protection
How to do itā€¦
How it worksā€¦
6. Authenticating in Flask
Introduction
Simple session-based authentication
Getting ready
How to do itā€¦
How it worksā€¦
See also
Authenticating using the Flask-Login extension
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Using OpenID for authentication
Getting ready
How to do itā€¦
How it worksā€¦
Using Facebook for authentication
Getting started
How to do itā€¦
How it works...
Using Google for authentication
Getting ready
How to do itā€¦
How it worksā€¦
Using Twitter for authentication
Getting ready
How to do itā€¦
How it worksā€¦
7. RESTful API Building
Introduction
Creating a class-based REST interface
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Creating an extension-based REST interface
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Creating a SQLAlchemy-independent REST API
Getting ready
How to do itā€¦
How it worksā€¦
See also
A complete REST API example
Getting ready
How to do itā€¦
See also
8. Admin Interface for Flask Apps
Introduction
Creating a simple CRUD interface
Getting ready
How to do itā€¦
How it worksā€¦
Using the Flask-Admin extension
Getting ready
How to do itā€¦
There's moreā€¦
Registering models with Flask-Admin
Getting ready
How to do itā€¦
Creating custom forms and actions
Getting ready
How to do itā€¦
How it worksā€¦
WYSIWYG for textarea integration
Getting ready
How to do itā€¦
How it worksā€¦
See also
Creating user roles
Getting ready
How to do itā€¦
How it worksā€¦
9. Internationalization and Localization
Introduction
Adding a new language
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Lazy evaluation and the gettext/ngettext functions
Getting ready
How to do...

Table of contents

  1. Flask Framework Cookbook