Cannot import checkbox when using Google App Engine

I am following this guide and trying to develop a Flask application to run on the Google App Engine. I followed the email manual, but when I start the Dev application server from Launcher and go to http: // localhost: 8080 / , I get an HTTP 500 error.

I check the magazines and he says No module named flask. Then I check the interactive console in the admin console by running import flask, and I get the same error message. I can import the jar into any other python file without errors.

Is there any way to fix this?

+3
source share
4 answers

Working a bit with GAE and Flask, I figured this out:

Python

python (python app.py) : pip install flask

dev_appserver.py

dev_appserver.py, GAE SDK, , : Flask, jinja2... : fooobar.com/questions/1901133/...

Python, Virtualenv, Flask GAE Windows

Python

setuptools MS Windows installer ( PIP Windows)

PIP

Virtualenv

  • pip install virtualenv
  • mkdir c:\virtualenvs, envs
  • cd c:\virtualenvs
  • virtualenv flaskdemo virtualenv
  • Active virtualvv c:\virtualenvs\flaskdemo\scripts\activate

SDK Google App Engine

( : https://github.com/maxcnunes/flaskgaedemo)

  • pip install flask

GAE

SDK GAE

  • Google App Engine Launcher
  • "", .
  • , "", .
+9

requirements.txt. , , pip install -t lib -r requirements.txt, lib.

, lib appengine_config.py vendor.add('lib'), .

+1

TL;DR: appengine_config.py virtualenv lib, , dev_appserver.py

( bash ubuntu) SO , , env gcloud -

env dir

.../.virtualenvs/nimble/local/lib/python2.7/site-packages

[projectdir]/lib

appengine_config.py, , , ,

dev_appserver.py [my proj dir here]

google.appengine . , dev-. .

, heres appengine_config.py

"""`appengine_config` gets loaded when starting a new application instance."""

print 'running app  config yaya!'

from google.appengine.ext import vendor
vendor.add('lib')
print 'I am the line after adding lib, it should have worked'
import os
print os.getcwd()
0

, , 1 , -,   appengine_config.py .

appengine_config.py , lib

from google.appengine.ext import vendor

#Add any libraries installed in the "lib" folder.
vendor.add('lib')

And since he could not find and execute appengine_config.py, so the folder was libnot registered as a dependency folder. To check that you can try to print something in appengine_config.pyto check if it is running at server startup.

0
source

All Articles