2017年12月8日
摘要: py文件: fabuview.html: 阅读全文
posted @ 2017-12-08 09:38 L文斌 阅读(149) 评论(0) 推荐(0) 编辑
  2017年12月5日
摘要: 主py: from flask import Flask, render_template, request, redirect, url_for, session from flask_sqlalchemy import SQLAlchemy import config from functool 阅读全文
posted @ 2017-12-05 09:06 L文斌 阅读(252) 评论(0) 推荐(0) 编辑
  2017年12月1日
摘要: py文件: from flask import Flask, render_template, request, redirect, url_for, session from flask_sqlalchemy import SQLAlchemy import config from functoo 阅读全文
posted @ 2017-12-01 16:44 L文斌 阅读(479) 评论(0) 推荐(0) 编辑
  2017年11月29日
摘要: 1. 在首页添加显示问答的列表,并定义好相应的样式。 无序列表 <ul > <li>Coffee</li> <li>Tea</li> <li>Milk</li> </ul> 2. 用字典向index.html传递参数。 daohang.html 阅读全文
posted @ 2017-11-29 15:56 L文斌 阅读(180) 评论(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 12:10 L文斌 阅读(179) 评论(0) 推荐(0) 编辑
  2017年11月24日
摘要: 主py: config.py: daohang.html: 阅读全文
posted @ 2017-11-24 09:43 L文斌 阅读(177) 评论(0) 推荐(0) 编辑
  2017年11月21日
摘要: 登录功能完成: session: py文件: config.py: denglu.js: denglu.html: 运行结果: 阅读全文
posted @ 2017-11-21 15:06 L文斌 阅读(615) 评论(0) 推荐(0) 编辑
  2017年11月17日
摘要: js文件: onclick函数return True时才提交表单,return False时不提交表单。 html文件: <form>中设置 action和method="post" <input> 中设置 name 主py文件中: from flask import request, redire 阅读全文
posted @ 2017-11-17 16:31 L文斌 阅读(197) 评论(0) 推荐(0) 编辑
  2017年11月15日
摘要: 增加:db.session.add(user)db.session.commit() 查询:User.query.filter(User.username == 'mis1114').first() 修改:user.password = '111111'db.session.commit() 删除:db.session.delete(user)db.session.commit() from f... 阅读全文
posted @ 2017-11-15 15:46 L文斌 阅读(201) 评论(0) 推荐(0) 编辑
  2017年11月14日
摘要: 安装与配置python3.6+flask+mysql数据库 下载安装MySQL数据库 下载安装MySQL-python 中间件 pip install flask-sqlalchemy (Python的ORM框架SQLAlchemy) mysql创建数据库 数据库配置信息config.py 建立my 阅读全文
posted @ 2017-11-14 09:52 L文斌 阅读(171) 评论(0) 推荐(0) 编辑