Connect Django to Google Cloud SQL

前端 未结 2 691
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 16:29

I\'m trying to connect Django to the Google cloud SQL, working with python 2.7 and django 1.5 under windows. I went through the instructions on this page: https://developers

2条回答
  •  庸人自扰
    2020-12-29 17:14

    That database configuration only makes sense when connecting from AppEngine. If you want to access your CloudSQL database from your local machine using django, you should use the google.appengine.ext.django.backends.rdbms engine.

    You can see the different configuration options here: https://developers.google.com/appengine/docs/python/cloud-sql/django#development-settings

    EDIT: The google.appengine.ext.django.backends.rdbms engine has been deprecated. If you want to connect to Google Cloud SQL from your local machine you should use IP connectivity. You can use the Cloud SQL instance IP (IPv4 or IPv6) and connect using the standard django.db.backends.mysql engine.

提交回复
热议问题