当谷歌App Engine上运行的应用程序烧瓶,它抛出我,我为我的应用程序在8080端口上 所以我指定的端口瓶在端口5000上运行谷歌应用程序引擎
if __name__ == "__main__":
app.run(port=8080)
错误
但在App Engine上运行它,它表明我的应用程序仍然是服务于https://127.0.0.1:5000
编辑:我上运行的应用程序的某个地方混淆,所以我试图运行在本地使用dev_appserver.py app.yaml
应用(这样会引发错误) 在运行dev_appserver.py ./
运行的服务器,但我在页是空白,而我得到的终端的错误,这是无法导入Python模块,即使我已经做了appengine_config.py
脚本,并下载到它的所有Python包一个lib子文件夹。
我的项目结构为:
root/ -app.py --lib/ --static/ --templates/ -app.yaml -appengine_config.py
编辑:服务器似乎是现在运行良好,但仍无法导入Python包(我安装了上述lib文件夹中,我也使用了系统黑客)这里的错误:
Traceback (most recent call last):
File "/home/padam/Downloads/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 240, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/home/padam/Downloads/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler
handler, path, err = LoadObject(self._handler)
File "/home/padam/Downloads/google-cloud-sdk/platform/google_appengine/google/appengine/runtime/wsgi.py", line 85, in LoadObject
obj = __import__(path[0])
File "/home/padam/Documents/git/gae-fumen/app.py", line 4
from flask import Flask, render_template, jsonify, request
^
我该如何解决它?
您需要在重新启动之前停止正在运行的服务器... –
假设您正在为标准环境开发,您可能还想看看官方Hello World回购 - https://github.c om/GoogleCloudPlatform/python-docs-samples/tree/master/appengine/standard/flask/hello_world – alpeware
@LaurentLAPORTE我做了 –