File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
appengine/standard/django Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 9292# Database
9393# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
9494
95+ # Check to see if MySQLdb is available; if not, have pymysql masquerade as
96+ # MySQLdb. This is a convenience feature for developers who cannot install
97+ # MySQLdb locally; when running in production on Google App Engine Standard
98+ # Environment, MySQLdb will be used.
99+ try :
100+ import MySQLdb # noqa: F401
101+ except ImportError :
102+ import pymysql
103+ pymysql .install_as_MySQLdb ()
104+
95105# [START db_setup]
96106if os .getenv ('SERVER_SOFTWARE' , '' ).startswith ('Google App Engine' ):
97107 # Running on production App Engine, so connect to Google Cloud SQL using
Original file line number Diff line number Diff line change 1- MySQL-python == 1.2.5
1+ PyMySQL == 0.7.11
22Django == 1.11.6
You can’t perform that action at this time.
0 commit comments