Skip to content

Instantly share code, notes, and snippets.

@Shinichi-Nakagawa
Created February 10, 2015 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shinichi-Nakagawa/d895f37cdc4177c83632 to your computer and use it in GitHub Desktop.
Save Shinichi-Nakagawa/d895f37cdc4177c83632 to your computer and use it in GitHub Desktop.
# ENGINEにPyMySQLの接続文字列を追加(4,5行目)
if ENGINE == 'sqlite':
dbString = ENGINE + ':///%s' % (DATABASE)
elif ENGINE == 'pymysql':
dbString = 'mysql+' + ENGINE + '://%s:%s@%s/%s' % (USER, PASSWORD, HOST, DATABASE)
else:
if USER and PASSWORD:
dbString = ENGINE + '://%s:%s@%s/%s' % (USER, PASSWORD, HOST, DATABASE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment