import pymysql
from dictmysql import DictMySQL
from attrdict import AttrDict
pymysql.cursors.DictCursor.dict_type = AttrDict
sql = DictMySQL(db=db_settings['database'], host=db_settings['host'], user=db_settings['username'],
passwd=db_settings['password'], charset=db_settings['charset'], port=db_settings['port'], cursorclass=pymysql.cursors.DictCursor)
コメント