当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 14

郝连祥 / Flask_Echarts
关闭

forked from 小码编程 / Flask_Echarts
关闭
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
application.py 857 Bytes
一键复制 编辑 原始数据 按行查看 历史
子沐 提交于 2018-06-08 09:23 . 更新项目
# coding:utf-8
import pymysql
from flask import Flask # 默认
from flask_cache import Cache
# from pymysqlpool import ConnectionPool
# app入口定义
app = Flask(__name__)
#链接数据库
mysql_config = {
'pool_name': 'test',
'host': 'localhost',
'port': 3306,
'user': 'root',
'password': 'root',
'database': 'test',
'charset': 'utf8'
}
# def connection_pool():
# pool = ConnectionPool(**mysql_config)
# pool.connect()
# return pool
conn = pymysql.connect(host='127.0.0.1', user='root', passwd='FanTan879', db='zp', charset='utf8')
cache = Cache()
config = {
'CACHE_TYPE': 'redis',
'CACHE_REDIS_HOST': '127.0.0.1',
'CACHE_REDIS_PORT': 6379,
'CACHE_REDIS_DB': '1',
'CACHE_REDIS_PASSWORD': 'FanTan879425'
}
app.config.from_object(config)
cache.init_app(app,config)
app.config.update(SECRET_KEY='tanxiangyu')
Python
1
https://gitee.com/wuvi/Flask_Echarts.git
git@gitee.com:wuvi/Flask_Echarts.git
wuvi
Flask_Echarts
Flask_Echarts
master

搜索帮助