摘要: from flask import Flask,request,views from functools import wraps app = Flask(__name__) #自定义登录装饰器 def login_required(func): @wraps(func) def wapper(*args,**kwargs): username = requ... 阅读全文
posted @ 2018-09-20 23:45 python成长中 阅读(1326) 评论(0) 推荐(0)
摘要: from flask import Flask,views,render_template,request app = Flask(__name__) app.debug = True class LoginView(views.MethodView): def __render(self,error=None): return render_templat... 阅读全文
posted @ 2018-09-20 21:57 python成长中 阅读(511) 评论(0) 推荐(0)
摘要: #上面的类方法看起来并没有函数好用,那为什么还要用它。 阅读全文
posted @ 2018-09-20 19:58 python成长中 阅读(1043) 评论(0) 推荐(0)
摘要: route的源码分析,解释url_for 和 add_url_rule的使用 看下 add_url_rule干了什么事 阅读全文
posted @ 2018-09-20 18:41 python成长中 阅读(8495) 评论(0) 推荐(0)
摘要: {% block title %}智联招聘{% endblock %} {% block block_body %} {% endblock %} {% block block_body_inherit %} {% endblock %} 主模板 {% extends 'base.html' %} {% b... 阅读全文
posted @ 2018-09-20 14:21 python成长中 阅读(203) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-09-20 12:13 python成长中 阅读(143) 评论(0) 推荐(0)
摘要: from flask import Flask,render_template app = Flask(__name__) @app.route('/') def hello_world(): return render_template('set_with_statement.html') if __name__ == '__main__': app.run(deb... 阅读全文
posted @ 2018-09-20 11:38 python成长中 阅读(571) 评论(0) 推荐(0)
摘要: from flask import Flask,render_template app = Flask(__name__) @app.route('/') def hello_world(): return render_template('include.html') if __name__ == '__main__': app.run(debug=True) ... 阅读全文
posted @ 2018-09-20 11:21 python成长中 阅读(1944) 评论(0) 推荐(0)
摘要: 使用的注意事项: 阅读全文
posted @ 2018-09-20 00:36 python成长中 阅读(887) 评论(0) 推荐(0)