I have a Django application running on the Google App Engine. I know how to perform migrations using the cloud proxy or by setting the DATABASES value, but I would like to automate the migration by performing it at the deployment stage. However, there seems to be no way to run a custom script before or after deployment.
The only way I came across is to do this in the entrypoint command, which you can set in app.yaml :
entrypoint: bash -c 'python3 manage.py migrate --noinput && gunicorn -b :$PORT app.wsgi'
It is very much like doing it wrong. Many of Google did not give a better answer.
source share