blob: df8711d5a882f4366b687d84c0f4a5d55f986079 (
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://{0[user]}:{0[pass]}@{0[host]}/{0[db]}?charset=utf8".format(
load_config('db')
)))
return session()
|