Context:
By default, App Engine looks for an app variable in a file called main.py. You have two options: put your WSGI app where App Engine expects it to be, or define a custom entrypoint:
You can create a file called main.py that has an app variable which is simply imported and aliased from the correct location:
from demosite.wsgi import main as app
From https://cloud.google.com/appengine/docs/standard/python3/config/appref:
entrypoint: Optional. The command that is executed when your app starts. For your app to receive HTTP requests,entrypointshould contain a command which starts a web server that listens on the port specified by the PORT environment variable. If you do not specify anentrypoint, App Engine will configure and start the Gunicorn webserver.
By default it's this:
entrypoint: gunicorn -b :$PORT main:app
You would need something like:
entrypoint: gunicorn -b :$PORT demosite.wsgi:main
See here for more details about application startup: https://cloud.google.com/appengine/docs/standard/python3/runtime#application_startup