blob: 94f07de20da647f2f5e995ac576e1c4d7648ff1c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from .config import load_config
def get_session():
session = sessionmaker(bind=create_engine(
"mysql+mysqlconnector://{0[user]}:{0[pass]}@{0[host]}/{0[db]}?charset=utf8".format(
load_config('db')
)))
return session()
|