config.ini
[database]
ip=172.25.23.32
port=3306
dbname=tommail
dbuser=root
dbpassword=W9OKxHUn
[redis]
redis_ip=172.25.16.145
redis_port=6379
redis_key=last-login/
config = configparser.ConfigParser()
config.read('config.ini')
ip = config.get('database','ip')
sport = config.get('database','port')
port = int(sport)
dbname = config.get('database','dbname')
dbuser = config.get('database','dbuser')
dbpassword = config.get('database','dbpassword')
mailuser = 'xxx@tom.com'
redis_ip=config.get('redis','redis_ip')
redis_port=config.get('redis','redis_port')
redis_key=config.get('redis','redis_key')