Building Web Applications with Flask
eBook - ePub

Building Web Applications with Flask

Italo Maia

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

Building Web Applications with Flask

Italo Maia

Book details
Book preview
Table of contents
Citations

Frequently asked questions

How do I cancel my subscription?
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.
Can/how do I download books?
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.
What is the difference between the pricing plans?
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.
What is Perlego?
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.
Do you support text-to-speech?
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.
Is Building Web Applications with Flask an online PDF/ePUB?
Yes, you can access Building Web Applications with Flask by Italo Maia in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Programación web. We have over one million books available in our catalogue for you to explore.

Information

Year
2015
ISBN
9781784396152

Building Web Applications with Flask


Table of Contents

Building Web Applications with Flask
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 in a Flask, I Mean, Book
An introduction to Flask and its features
Summary
2. First App, How Hard Could it Be?
Hello World
Prerequisites and tools
Setting up a virtual environment
Understanding the "Hello World" app
Serving HTML pages
Summary
3. Man, Do I Like Templates!
What is Jinja2 and how is it coupled with Flask?
What can you do with Jinja2?
Control structures
Macros
Extensions
Filters
Messing with the template context
Summary
4. Please Fill in This Form, Madam
HTML forms for the faint of heart
Handling forms
WTForms and you
Flask-WTF
Integration with WTForms
Securing forms with a CSRF token
Challenges
Summary
5. Where Do You Store Your Stuff?
SQLAlchemy
Concepts
Hands on
Flask-SQLAlchemy
MongoDB
MongoEngine
Flask-MongoEngine
Relational versus NoSQL
Summary
6. But I Wanna REST Mom, Now!
Beyond GET
Flask-Restless
Summary
7. If Ain't Tested, It Ain't Game, Bro!
What kinds of test are there?
Unit testing
Behavior testing
Flask-testing
LiveServer
Extra assertions
JSON handle
Fixtures
Extra – integration testing
Summary
8. Tips and Tricks or Flask Wizardry 101
Overengineering
Premature optimization
Blueprints 101
Oh God, please tell me you have the logs…
Debugging, DebugToolbar, and happiness
Flask-DebugToolbar
Sessions or storing user data between requests
Exercise
Summary
9. Extensions, How I Love Thee
How to configure extensions
Flask-Principal and Flask-Login (aka Batman and Robin)
Admin like a boss
Custom pages
Summary
10. What Now?
You deploy better than my ex
Placing your code in a server
Setting up your database
Setting up the web server
StackOverflow
Structuring your projects
Summary
Postscript
Index

Building Web Applications with Flask

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: June 2015
Production reference: 1240615
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-615-2
www.packtpub.com

Credits

Author
Italo Maia
Reviewers
Glenn ten Cate
Michel Henrique Aquino Santos
Commissioning Editor
Nadeem N. Bagban
Acquisition Editor
Harsha Bharwani
Content Development Editor
Shubhangi Dhamgaye
Technical Editor
Shruti Rawool
Copy Editors
Stephen Copestake
Swati Priya
Project Coordinator
Bijal Patel
Proofreader
Safis Editing
Indexer
Mariammal Chettiyar
Production Coordinator
Nilesh R. Mohite
Cover Work
Nilesh R. Mohite

About the Author

Italo Maia is a full-stack developer with 10 years of experience in creating software for the mobile, Web, and desktop environments, having dedicated most of the last few years to development with Python and web technologies.
Author of Flask-Empty, a popular skeleton for Flask projects that aggregates good practices and recipes for quick prototyping, he is active in the Brazilian Python communities, having open source tools and libraries available in GitHub and Bitbucket.

About the Reviewers

Glenn ten Cate has over 10 years of experience in the field of security as a coder, hacker, speaker, trainer, and security researcher. He is currently employed as a security engineer at Schuberg Philis in the Netherlands, and has been a speaker at multiple security conferences. His goal is to create an open source software development life cycle approach with the tools and knowledge gathered over the years.
Michel Henrique Aquino Santos is a software engineer with Gravity4. A Brazilian from Belo Horizonte, Minas Gerais, he is 26 years old. He graduated in computer science from the Federal University of Lavras (UFLA) in 2012.
He worked with the research department at the university for 2 years, developing artificial intelligence algorithms to solve optimization problems.
At the end of the course, he joined Tbit and started developing image processing algorithms using C#.
After his graduation, he joined SYDLE and worked with ASP.NET Web Forms using C#, JavaScript, and the MS SQL Server database. After that, he worked with Delphi and the MS SQL server database at Sociedade Mineira de Cultura.
In January 2014, he joined Ezlike, a start-up focused on creating, managing, and optimizing Facebook ads. In April 2015, Ezlike was acquired by the US-based company Gravity4 in order to incorporate a number of other tools focused on digital marketing. There, he works with ASP.NET MVC, JavaScript, AngularJS, KnockoutJS, MongoDB, MS SQL Server, and Cassandra using the Facebook Ads API.
He is also about to begin some personal projects using Python and developing for Android.

www.PacktPub.com

Support files, eBooks, discount offers, and more

For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
Support files, eBooks, discount offers, and more
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?

  • Fully searchable across every book published by Packt
  • Copy and paste, print, and bookmark content
  • On demand and accessible via a web browser

Free access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.
This book is dedicated to my angel, my inspiration, and my light—my son, Miguel—who never fails to amaze me in his endeavors to become a fine young man or cheer up the family.

Preface

One can hardly develop new applications in our "now world" without duct-taping a lot of technologies together, be it new trend databases, messaging systems, or languages of all kinds. When talking about web dev...

Table of contents