Skip to content Skip to sidebar Skip to footer

Deploy Python Script On Google Cloud Platform

I'm figuring out how to deploy my script on google cloud platform. ive already made a directory or folder that contains the script.pyand all the libraries in /lib folder. what i d

Solution 1:

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.

Post a Comment for "Deploy Python Script On Google Cloud Platform"