Python 3.7 Local Development Server Options for new app engine apps

For windows 10 :

The solution was to install a linux subsystem for windows : https://learn.microsoft.com/en-us/windows/wsl/install-win10

I use the Ubuntu app from the windows store, and follow the installation for installing the gcloud component on linux inside the ubuntu terminal: https://https://learn.microsoft.com/en-us/windows/wsl/install-win10cloud.google.com/sdk/docs/#deb

Inside the Ubuntu terminal it is possible to access the windows file : the C drive would be /mnt/c. Getting back to my work folder, it is possible to start the web-app using the dev_appserver command.

Using a navigator from windows we have access to the web-app as normal using localhost:8080.

The development can still be done using an IDE in windows, running the server in Ubuntu.


The dev_appserver.py support for Python 3 is still limited. From Running the local development server:

Note:

  • Running dev_appserver requires the presence of Python 2.7.12+ on your local machine.
  • The updated dev_appserver does not support development of Python 3 apps on Windows.

Which might be why it is not the recommended solution for local development (or at least not yet). From Running locally:

We do not recommend that you depend on tools like dev_appserver, the local development server provided with the Google Cloud SDK. However, if you are migrating an existing App Engine application from Python 2 to Python 3, we have updated dev_appserver to facilitate this process. For all other local development scenarios, we recommend standard Python testing approaches.

For example, you can usually run a Flask application with Flask's development server using:

python main.py

Django applications can be started using:

python manage.py runserver

To simulate a production App Engine environment, you can run the full Web Server Gateway Interface (WSGI) server locally. To do this, use the same command specified as entrypoint in your app.yaml, for example:

gunicorn -b :$PORT main:app