Building Web Applications with Flask
eBook - ePub

Building Web Applications with Flask

Italo Maia

Partager le livre
  1. 160 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Building Web Applications with Flask

Italo Maia

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Building Web Applications with Flask est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Building Web Applications with Flask par Italo Maia en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Ciencia de la computaciĂłn et ProgramaciĂłn web. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
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 des matiĂšres