I have deployed django application in app engine flexible.
I'm able to run migrations using cloud_sql_proxy. But i want to add migrate step as a part of deployment. Where do i specify that in app.yaml file ? Also tried
gcloud beta app gen-config --custom
Which creates docker file. on adding migration command in docker file, recieved the following error:
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
Settings.py
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'test',
'USER': 'test',
'PASSWORD': 'password',
'PORT': '5432',
'HOST': 'connection-name',
}}
app.yaml
runtime: python
env: flex
entrypoint: gunicorn -b :$PORT wsgi
beta_settings:
cloud_sql_instances: connection-name
runtime_config:
python_version: 3
Please suggest approach to add migrate command.