I've been experimenting with GAE, and struggling to get Google's flask example working with dev_appserver.py. Despite using the simple code given, I was receiving the dreaded 'ImportError: No module named flask' error. (It did work via the flask server, if needed, tho' obviously this didn't help.)
This is despite having flask (and all related dependencies) installed in the /lib sub-folder of my project folder, and despite the (supposedly) correct code in appengine_config.py (see all below). I also tried multiple small variations of these files, to no avail.
THEN... I saw this post, and tried just copying all of the contents of projectfolder/ lib/python/site-packages into projectfolder/ ... and now it seems to work perfectly.
Can anyone see what am I missing (as I'd prefer to have the neat folder structure as advertised)? Or is this a GAE bug, as it seems that vendor.add just isn't doing what it should?
app.yaml
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /.*
script: main.app
main.py
import logging
from flask import Flask, render_template, request
app = Flask('test')
@app.route('/')
def hello():
return 'Hello World!'
appengine_config.py
from google.appengine.ext import vendor
print "*** appengine_config ***" # Just to see if/when it's being run
# Add any libraries installed in the "lib" folder.
vendor.add('lib')