We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b561761 + 123c4d5 commit d757e84Copy full SHA for d757e84
appengine/standard_python37/django/mysite/settings.py
@@ -79,6 +79,16 @@
79
# Database
80
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases
81
82
+# Check to see if MySQLdb is available; if not, have pymysql masquerade as
83
+# MySQLdb. This is a convenience feature for developers who cannot install
84
+# MySQLdb locally; when running in production on Google App Engine Standard
85
+# Environment, MySQLdb will be used.
86
+try:
87
+ import MySQLdb # noqa: F401
88
+except ImportError:
89
+ import pymysql
90
+ pymysql.install_as_MySQLdb()
91
+
92
# [START db_setup]
93
if os.getenv('GAE_APPLICATION', None):
94
# Running on production App Engine, so connect to Google Cloud SQL using
0 commit comments