Python for Google App Engine
eBook - ePub

Python for Google App Engine

Massimiliano Pippi

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

Python for Google App Engine

Massimiliano Pippi

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 Python for Google App Engine an online PDF/ePUB?
Yes, you can access Python for Google App Engine by Massimiliano Pippi in PDF and/or ePUB format, as well as other popular books in Computer Science & Application Development. We have over one million books available in our catalogue for you to explore.

Information

Python for Google App Engine


Table of Contents

Python for Google App Engine
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
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started
The cloud computing stack – SaaS, PaaS, and IaaS
Google Cloud Platform
Hosting + Compute
Storage
BigQuery
Services
What Google App Engine does
The runtime environment
The services
Making our first Python application
Download and installation
Installing on Windows
Installing on Mac OS X
Installing on Linux
App Engine Launcher
Creating the application
The app.yaml configuration file
The main.py application script
Running the development server
Uploading the application to App Engine
Google Developer Console
Development Console
Summary
2. A More Complex Application
Experimenting on the Notes application
Authenticating users
HTML templates with Jinja2
Handling forms
Persisting data in Datastore
Defining the models
Basic querying
Transactions
Using static files
Summary
3. Storing and Processing Users' Data
Uploading files to Google Cloud Storage
Installing Cloud Storage Client Library
Adding a form to upload images
Serving files from Cloud Storage
Serving files through Google's Content Delivery Network
Serving images
Serving other types of files
Transforming images with the Images service
Processing long jobs with the task queue
Scheduling tasks with Cron
Sending notification e-mails
Receiving users' data as e-mail messages
Summary
4. Improving Application Performance
Advanced use of Datastore
More on properties – arrange composite data with StructuredProperty
More on queries – save space with projections and optimize iterations with mapping
Projection queries
Mapping
NDB asynchronous operations
Caching
Backup and restore functionalities
Indexing
Using Memcache
Breaking our application into modules
Summary
5. Storing Data in Google Cloud SQL
Creating a Cloud SQL instance
Configuring access
Setting the root password
Connecting to the instance with the MySQL console
Creating the notes database
Creating a dedicated user
Creating tables
Connecting to the instance from our application
Loading and saving data
Using the local MySQL installation for development
Summary
6. Using Channels to Implement a Real-time Application
Understanding how the Channel API works
Making our application real time
Implementing the server
The JavaScript code for clients
Tracking connections and disconnections
Summary
7. Building an Application with Django
Setting up the local environment
Configuring a virtual environment
Installing dependencies
Rewriting our application using Django 1.7
Using Google Cloud SQL as a database backend
Creating a reusable application in Django
Views and templates
Authenticating users with Django
Using the ORM and migrations system
Processing forms with the Forms API
Uploading files to Google Cloud Storage
Summary
8. Exposing a REST API with Google Cloud Endpoints
Reasons to use a REST API
Designing and building the API
Resources, URLs, HTTP verbs, and response code
Defining resource representations
Implementing API endpoints
Testing the API with API Explorer
Protecting an endpoint with OAuth2
Summary
Index

Python for Google App Engine

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: January 2015
Production reference: 1210115
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-819-4
www.packtpub.com

Credits

Author
Massimiliano Pippi
Reviewers
Dom Derrien
Samuel Goebert
Marcos Placona
Commissioning Editor
Taron Pereira
Acquisition Editor
Richard Brookes-Bland
Content Development Editor
Vaibhav Pawar
Technical Editor
Tanmayee Patil
Copy Editors
Deepa Nambiar
Vikrant Phadke
Stuti Srivastava
Project Coordinator
Kranti Berde
Proofreaders
Simran Bhogal
Maria Gould
Ameesha Green
Paul Hindle
Indexer
Priya Sane
Production Coordinator
Nitesh Thakur
Cover Work
Nitesh Thakur

About the Author

Massimiliano Pippi has been a software developer for over 10 years, more than half of which he spent working with scientific visualization and backend software for a private company, using C++ and Qt technologies. He started using Python in 2008 and currently works at Evonove, a small company where he has been leading a number of Python software projects, most of which are based on the Django web framework. He is also an open source advocate and active contributor, documentation fanatic, and speaker at conferences. He writes about Python and other development-related topics at http://dev.pippi.im.

About the Reviewers

Dom Derrien is a full-stack web developer who has been defining application environments with a focus on high availability and scalability. He's been in the development field for more than 15 years and has worked for big and small companies and also as an entrepreneur.
He's currently working for the game company Ubisoft Inc., where he defines the next generation services platform for its successful AAA games. To extend the gamer experience on the Web and on mobiles, he provides technical means that are transparent, efficient, and highly flexible.
On receiving the invitation to review this book, after a comparable work for the books Google App Engine Java and GWT Application Development, Packt Publishing, he was pleased to share his knowledge about Google App Engine again.
Samuel Goebert is a computer science PhD student at Plymouth University, UK. Samuel has over 12 years of experience in software development and associated technologies. For further details about him, check out his LinkedIn profile at www.linkedin.com/in/samuelgoebert.
Marcos Placona grew up in Sao Paulo, Brazil, and started tinkering with web development when 14.400 kbs modems were the coolest thing.
He then eagerly pursued a computer science degree and soon after an opportunity arose on the other side of the Atlantic. In his 20s, he decided to move to England where he worked as a software engineer at a software house. He also started blogging on www.placona.co.uk.
Marcos has published and printed articles in several w...

Table of contents