摘要: 在之前我们测试中,所有语句都在同一个文件中,但随着项目越来越大,管理起来有所不便,所以将Models分离.基本的文件结构如下\—–app.py\—–models.py from flask import Flask from flask_sqlalchemy import SQLAlchemy fr 阅读全文
posted @ 2020-08-12 18:14 兰嘉轩 阅读(242) 评论(0) 推荐(0)
摘要: flask 三方插件 Flask-AppBuilder - Simple and rapid Application builder, includes detailed security, auto form generation, google charts and much more. Fla 阅读全文
posted @ 2020-08-12 18:13 兰嘉轩 阅读(175) 评论(0) 推荐(0)
摘要: 将pip源更换到国内镜像 用pip管理工具安装库文件时,默认使用国外的源文件,因此在国内的下载速度会比较慢,可能只有50KB/s。幸好,国内的一些顶级科研机构已经给我们准备好了各种镜像,下载速度可达2MB/s。其中,比较常用的国内镜像包括:(1)阿里云 http://mirrors.aliyun.c 阅读全文
posted @ 2020-08-12 18:06 兰嘉轩 阅读(201) 评论(0) 推荐(0)
摘要: Python中类的魔术方法 在Python中以两个下划线开头的方法,__init__、__str__、__doc__、__new__等,被称为"魔术方法"(Magic methods)。魔术方法在类或对象的某些事件出发后会自动执行,如果希望根据自己的程序定制自己特殊功能的类,那么就需要对这些方法进行 阅读全文
posted @ 2020-08-12 17:28 兰嘉轩 阅读(154) 评论(0) 推荐(0)