Commit 154be8b3 authored by 彭熊's avatar 彭熊

Merge branch 'dev' into 'master'

MySQL数据库引擎配置

See merge request !1
parents 39fdda12 d9d3e5a5
......@@ -5,4 +5,7 @@
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>
\ No newline at end of file
......@@ -23,20 +23,20 @@ CFG_FILEPATH = work_dir + '/app/config/config.yaml'
config = yaml.load(open(CFG_FILEPATH, 'r'), Loader=yaml.FullLoader)
tamp_user_engine = create_engine(
tamp_product_engine = create_engine(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'.format(
db=config[env]['MySQL']['tamp_user_db'],
db=config[env]['MySQL']['tamp_product_db'],
host=config[env]['MySQL']['host'],
port=config[env]['MySQL']['port'],
user=config[env]['MySQL']['user'],
password=config[env]['MySQL']['password'],
charset="utf8"
),
charset="utf8"),
echo=True
)
tamp_pay_engine = create_engine(
tamp_order_engine = create_engine(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'.format(
db=config[env]['MySQL']['tamp_pay_db'],
db=config[env]['MySQL']['tamp_order_db'],
host=config[env]['MySQL']['host'],
port=config[env]['MySQL']['port'],
user=config[env]['MySQL']['user'],
......@@ -44,8 +44,21 @@ tamp_pay_engine = create_engine(
charset="utf8"),
echo=True
)
tamp_user_engine = create_engine(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'.format(
db=config[env]['MySQL']['tamp_user_db'],
host=config[env]['MySQL']['host'],
port=config[env]['MySQL']['port'],
user=config[env]['MySQL']['user'],
password=config[env]['MySQL']['password'],
charset="utf8"
),
echo=True
)
tamp_product_session = sessionmaker(bind=tamp_product_engine)()
tamp_order_session = sessionmaker(bind=tamp_order_engine)()
tamp_user_session = sessionmaker(bind=tamp_user_engine)()
tamp_pay_session = sessionmaker(bind=tamp_pay_engine)()
# redis = redis.StrictRedis(
# host=config[env]['redis']['host'],
......
dev:
MySQL:
tamp_product_db: tamp_product
tamp_order_db: tamp_order
tamp_user_db: tamp_user
tamp_pay_db: tamp_pay
host: 47.101.189.151
port: 31931
user: root
......@@ -18,8 +19,9 @@ dev:
test:
MySQL:
tamp_product_db: tamp_product
tamp_order_db: tamp_order
tamp_user_db: tamp_user
tamp_pay_db: tamp_pay
host: 118.190.63.109
port: 3306
user: root
......@@ -36,8 +38,9 @@ test:
prod:
MySQL:
tamp_product_db: tamp_product
tamp_order_db: tamp_order
tamp_user_db: tamp_user
tamp_pay_db: tamp_pay
host: pc-uf666afrpfg8yj768.rwlb.rds.aliyuncs.com
port: 3306
user: tamp_pay
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment