2017年12月6日

摘要: 主PY文件写视图函数,带id参数。 @app.route('/detail/<question_id>') def detail(question_id): quest = return render_template('detail.html', ques = quest) 首页标题的标签做带参数 阅读全文
posted @ 2017-12-06 00:35 043李庆 阅读(118) 评论(0) 推荐(0) 编辑

2017年12月1日

摘要: 首页列表显示全部问答: 将数据库查询结果传递到前端页面 Question.query.all() 前端页面循环显示整个列表。 问答排序 完成问答详情页布局: 包含问答的全部信息 评论区 以往评论列表显示区。 在首页点击问答标题,链接到相应详情页。 阅读全文
posted @ 2017-12-01 12:07 043李庆 阅读(104) 评论(0) 推荐(0) 编辑

2017年11月30日

摘要: 1. 在首页添加显示问答的列表,并定义好相应的样式。 无序列表 <ul > <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul> 2. 用字典向index.html传递参数。 阅读全文
posted @ 2017-11-30 12:14 043李庆 阅读(125) 评论(0) 推荐(0) 编辑

2017年11月28日

摘要: 编写要求登录的装饰器 from functools import wraps def loginFirst(func): #参数是函数 @wraps(func) def wrapper(*args, ** kwargs): #定义个函数将其返回 #要求登录 return func(*args, ** 阅读全文
posted @ 2017-11-28 14:21 043李庆 阅读(128) 评论(0) 推荐(0) 编辑

2017年11月24日

摘要: 用上下文处理器app_context_processor定义函数 获取session中保存的值 返回字典 @app.context_processor def mycontext(): username = session.get('user') if username: return {'username':username} else: ... 阅读全文
posted @ 2017-11-24 09:44 043李庆 阅读(93) 评论(0) 推荐(0) 编辑

2017年11月21日

摘要: 登录功能完成: session: 阅读全文
posted @ 2017-11-21 15:07 043李庆 阅读(114) 评论(0) 推荐(0) 编辑

2017年11月17日

摘要: js文件: onclick函数return True时才提交表单,return False时不提交表单。 html文件: 主py文件中: def regist(): if request.method == 'GET': return render_template('regist.html') e 阅读全文
posted @ 2017-11-17 11:03 043李庆 阅读(175) 评论(0) 推荐(0) 编辑

2017年11月15日

摘要: 增加:db.session.add(user)db.session.commit() user = User(username='mis111',password='mis1114') db.session.add(user) db.session.commit() 查询:User.query.filter(User.username == 'mis1114').first() u... 阅读全文
posted @ 2017-11-15 16:00 043李庆 阅读(135) 评论(0) 推荐(0) 编辑

2017年11月14日

摘要: 1、安装与配置python3.6+flask+mysql数据库 下载安装MySQL数据库 下载安装MySQL-python 中间件 pip install flask-sqlalchemy (Python的ORM框架SQLAlchemy) mysql创建数据库 2、数据库配置信息config.py 阅读全文
posted @ 2017-11-14 14:21 043李庆 阅读(225) 评论(0) 推荐(0) 编辑

2017年11月8日

摘要: 1、带label的文本输入区域 <label for=""></label> <textarea " id=""></textarea> html代码: css: 2、为什么要进行管理信息系统的战略规划? 管理信息系统的战略规划是一个组织战略规划的重要组成部分,是关于管理信息系统长远发展的规划。由于 阅读全文
posted @ 2017-11-08 20:21 043李庆 阅读(163) 评论(0) 推荐(0) 编辑

导航