I've followed two tutorials to deploy my Django app to App Engine and to connect to the database:
https://medium.com/@BennettGarner/deploying-a-django-application-to-google-app-engine-f9c91a30bd35 https://cloud.google.com/python/django/appengine
I have the app "succesfully" running atm, but from print statenments I can see from the log information that as soon as the site reaches a point where it needs to query the database it times out (after 5min or so).
So that suggests to me that there are some issues with the App Engine and Cloud SQL connection. I have succesfully the django site connected locally through the cloud sql proxy, and I try to deploy with the same configurations but doesn't seem to work.
I suspect that the issue is one of the following:
- The Cloud SQL Configs should be different when running the app locally vs. in app engine (settings.py)
- In some examples I've seen the Main.py contain a lot of stuff around the database connection, but in neither of the tutorials do they do this, for example this is the GCP tutorial on the main.py file: https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/appengine/standard_python3/django/main.py
I've checked that all App Engines inside the project have access to CLoud SQL by default, and the user also has access (i've used it for access).
I'm not able to move forward currently, and looking for inspiration/clues/solutions on where to look next.
Error messages which show up in logs are: