Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Without author's permission, this code is only for learning and cannot be used for other purposes.
Clone or download
global_seting.py 560 Bytes
Copy Edit Web IDE Raw Blame History
Mendalas authored 2019-06-12 18:07 . new create
import ConfigParser
def getMysqlURI():
conf = ConfigParser.ConfigParser()
conf.read("./conf/database.conf")
string = 'mysql+pymysql://'
string+= (conf.get('mysql', 'user')+":")
string+= (conf.get('mysql', 'password')+"@")
string+= (conf.get('mysql', 'host')+":")
string+= (conf.get('mysql', 'port')+"/")
string+="ins_sys?charset=utf8"
return string
def getRedisIpAndPort():
conf = ConfigParser.ConfigParser()
conf.read("./conf/database.conf")
return str(conf.get('redis', 'host')),str(conf.get('redis', 'port'))

Comment ( 0 )

Sign in for post a comment