Deploy python script on google cloud platform

末鹿安然 提交于 2019-12-02 03:42:24

From the script row in the Handlers element table:

A script: directive must be a python import path, for example, package.module.app that points to a WSGI application. The last component of a script: directive using a Python module path is the name of a global variable in the module: that variable must be a WSGI app, and is usually called app by convention.

Note: just like for a Python import statement, each subdirectory that is a package must contain a file named __init__.py

I'd recommend spending some time going through the code snippets from Quickstart for Python App Engine Standard Environment, where you'll see a basic structure of a simple app.

A requirements.txt file can be used to specify the list of packages to be installed in the lib directory, like this:

pip install -r requirements.txt -t lib

But it's not absolutely necessary, packages can be explicitly specified directly on the pip cmdline as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!