Reputation: 1
I can run my app locally using
dev_appserver.py app.yaml
And my app works. However, when I try to deploy to app engine, I'm given the following warning: WARNING: [runtime: python-compat]
is deprecated. Please use [runtime: python]
instead. See https://cloud.google.com/appengine/docs/flexible/python/migrating for more info.
I tried using runtime: python, however when I do so nothing works locally. Also, when I use python-compat, I cannot deploy to app engine, I just get Updating service [default]
. I'm using Python 2.7, what should I change to fix my runtime issues? app.yaml below
runtime: python-compat
env: flex
entrypoint: gunicorn -b :$PORT main:app
runtime_config:
python_version: 2
threadsafe: true
handlers:
- url: /.*
script: main.app
- url: /static
static_dir: static
- url: .*
script: main.app
Upvotes: 0
Views: 271
Reputation: 39814
FWIW, running the app locally through dev_appserver.py
is only applicable to the standard environment, you were simply lucky to be able to run it (maybe because of the now deprecated python-compat
runtime?). From Using the Local Development Server:
Note:
dev_appserver.py
does not run in the App Engine flexible environment.
For the flexible environment you normally need to run your app the same way you'd run it on GAE, see Running locally for details. In your case it'd be:
gunicorn -b :$PORT main:app
With this in mind switching to runtime: python
should no longer be an issue, you'd simply align with the official recommendations.
Side note: potentially of interest: How to tell if a Google App Engine documentation page applies to the standard or the flexible environment
Upvotes: 1