随笔分类 - Flask框架
摘要:1 from flask import Flask 2 from flask_cors import CORS#pip install Flask-CORS#跨域请求模块 3 app = Flask(__name__) 4 app.debug = True 5 CORS(app)#跨域请求 6 7 if __name__ == '__main__': 8 app.run('0.0.0.0', 95
阅读全文
摘要:SQLAlchemy是Python编程语言下的一款开源软件。提供了SQL工具包及对象关系映射(ORM:Object Relational Mappers)工具。SQLAlchemy“采用简单的Python语言,为高效和高性能的数据库访问设计,实现了完整的企业级持久模型”。SQLAlchemy的理念是
阅读全文
摘要:本节目录: (一)笔记总结; (二)gevent-websocket+flask+javascript实现WS即时通信 (1)无昵称群聊 (2)有昵称群聊 (3)私聊 三种通信模型简述: flask中基于gevent-websocket的IO多路复用技术进行长连接通信: http请求协议和webso
阅读全文
摘要:1 from flask import Flask, views, render_template, request, session, redirect 2 import redis as redis #pip install redis 3 from flask_session import Session#pip install Flask-session 4 5 app ...
阅读全文
摘要:flask_jinjia2.py jinjia2daemo.html
阅读全文
摘要:flask_decorators.py index.html
阅读全文
摘要:flask_Blueprint.py Bp1.py Bp2.py indx0.html
阅读全文
摘要:flask_config.py index0.html seetings.py
阅读全文
摘要:1 ''' 2 app.py中的源码def route(self, rule, **options) 3 @app.route()路由参数使用: 4 1.第一个位置参数为路由分发的请求路径 5 ①静态参数路由:/index / /base 等 6 ②动态参数路由:/index/ 在路由中使用了的路由称为动态路由, 7 ...
阅读全文
摘要:templates模板文件中的页面login.html
阅读全文
摘要:templates模板文件中的页面index.html:
阅读全文