最底下可以对话哈哈哈!
This is a small management system for dig-potency studio. We use Flask which is a popular webdevelopment framework for Python. And this is the first project from Luo & Lyu.
Also, this is a gift for my friend Arrow. Hope this can make sense.
- Mac 10.11
- Python 2.11
- Flask 0.11
- Mysql 5.7
- jqGrid 5.1.1
-
virtualenv, flask Details
sudo pip install virtualenv
mkdir myproject && cd myproject
virtualenv venv
sudo pip install flask
-
flask-mysql, pandas, pygal, xlrd
sudo pip install flask-mysql
sudo pip install pandas
sudo pip install pygal
sudo pip install xlrd
-
pycharm Download
from flaskext.mysql import MySQL
时会有unresolved reference
的错误。按以下步骤解决。 -
mysql 与 MYSQLWorkbench Download
- 进入Mysql Workbench.
- File -> Open SQL Script -> Find ./database_design/rou.sql -> Excute
- Find ./database_design/sp_insertData.sql -> Excute
- Find ./database_design/sp_insertStuCoach.sql -> Excute
- Find ./database_design/sp_updateData.sql -> Excute
-
jqGrid配置
` <script src="../static/js/jquery-3.1.0.js"></script><script src="../static/js/showAndDelete.js"></script> <script src="../static/js/grid.locale-cn.js" type="text/javascript"></script> <script src="../static/js/jquery.jqGrid.min.js" type="text/javascript"></script> <script src="../static/jquery-ui/jquery-ui.min.js" type="text/javascript"></script> <link href="../static/jquery-ui/jquery-ui.min.css" type="text/css" media="screen" rel="stylesheet"> <link href="../static/css/ui.jqgrid.css" type="text/css" media="screen" rel="stylesheet">` </pre>
至此,配置基本结束。
- Dpdb.py 中Mysql配置时的数据库名称、用户名要匹配。
- 为了防止插入数据库汉字出现乱码:
- connect中设置charset='utf8'
- 保证数据库和表的编码都是utf8
- 保证pythonFile采用utf8编码
- 创建好数据库之后,在Mysql workbench中运行’sp_insertStuCoach.sql‘,’sp_inserData.sql‘两个脚本,将两个过程存储入数据库当中;
- 在点击进入上传界面时,点击‘选择文件’按钮,弹出对话框,选择excel(.xls, .xlsx)文件,可多选。点击‘上传’按钮,会弹出上传结果。若失败,则会输出错误信息;若上传成功,则会显示已上传的文件名,点击‘返回’可以返回至上一层。
- 采用pandas的dataframe对excel表格完整拉取,为了防止出现意外,在date三行进行全值判断,有空,则判断该行无效;
This is from Lyu, my job is to get data from database and analysis the data and draw some graphs and export some data for user to ananlysis.
- setuptools (19.2)
- 配置文件详见 setup.py
Lyu @ Luo: 我们把自己的东西往里加吧?以这个为模板。感觉如何?
2016.08.20
Lyu @ Luo: 外面分别去完成homepagei.html 与 showResult.html
2016.08.22
Lyu @ Luo: 我已经把画图和下拉基本功能实现了.
2016.08.26