Set current project

gcloud config set project [PROJECT_ID]

How to update app

https://cloud.google.com/appengine/docs/standard/python/config/appref

To use the gcloud app deploy command, you must specify the --project flag:

gcloud app deploy --project [YOUR_PROJECT_ID]

How to clear (reset) local datastore

dev_appserver.py --clear_datastore=yes myapp

How to filter long requests

In https://console.cloud.google.com/logs/viewer in advanced filter mode

protoPayload.latency > 10s

Accessing app with remote shell

https://developers.google.com/appengine/articles/remote_api https://groups.google.com/forum/?fromgroups=#!topic/google-appengine/ZN3YLfS1Ze4

builtins:
- remote_api: on
export PYTHONPATH=.
python $GAE_SDK_ROOT/remote_api_shell.py -s your_app_id.appspot.com
>>> import helloworld
>>> from google.appengine.ext import db
>>> # Fetch the most recent 10 guestbook entries
>>> entries = helloworld.Greeting.all().order("-date").fetch(10)
>>>
>>> # Create our own guestbook entry
>>> helloworld.Greeting(content="A greeting").put()

Setting up debug variable to be False in production

http://webapp-improved.appspot.com/guide/app.html#debug-flag

import os

import webapp2

debug = os.environ.get('SERVER_SOFTWARE', '').startswith('Dev')

app = webapp2.WSGIApplication(routes=[
    (r'/', 'handlers.HelloWorldHandler'),
], debug=debug)

Binding IP for external excess

http://blog.docuverse.com/2009/01/30/google-app-engine-launcher-options/

Add to Extra Flags box: --address=192.168.0.x

If you add the address 0.0.0.0 then the SDK server will respond to any IP address (and still respond to “localhost” too). Useful when you’re local IP is assigned by DHCP, i.e. changes frequently.

Installing Google App Engine under Linux

Download SDK from https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python Unzip and

sudo mv google_appengine /usr/local/google_appengine

it is important to first unzip as a normal user and then copy.

Frameworks

If the project is very small I would recommend native Google-written webapp framework, it is good. Wikipedia has the list of frameworks that could be used with GAE. Here are some I used (this is only for Python):

  • Flask - minimalistic framework. flasktodo on GitHub may be a good starting point. At the moment, this may be my first choice. Flask-appengine-template - another good template to start with Flask development on GAE, a little bit more complex (WTForms, profiling etc.).
  • Tipfy - very fast framework developed for GAE, but recently updated so that could be used without it. The current version is 1.0b, but the documentation is still behind. Very nice multi-auth module.
  • Django-nonrel - it may be a good choice for somebody already very familiar with Django.