09 2020 档案

摘要:concern_set = models.Concern.objects.filter(user_id=1).values("concern_id") querysets = models.Task.objects.none() # 创建一个空的对象 for concern_id in concer 阅读全文
posted @ 2020-09-28 15:33 PythonNew_Mr.Wang 阅读(404) 评论(0) 推荐(0) 编辑
摘要:1:创建数据库以及更新数据库 #!/usr/bin/env python # -*- coding:utf-8 -*- from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Int 阅读全文
posted @ 2020-09-27 22:34 PythonNew_Mr.Wang 阅读(627) 评论(0) 推荐(0) 编辑
摘要:manage.py: from BlueMap.pro_flask import create_app app = create_app() if __name__ == '__main__': app.run() settins.py # debug模式 class DebugSetting(ob 阅读全文
posted @ 2020-09-27 14:08 PythonNew_Mr.Wang 阅读(450) 评论(0) 推荐(0) 编辑
摘要:from flask import Flask, render_template,flash,get_flashed_messages app = Flask(__name__) app.secret_key=("21h3i2o1") @app.route('/x1') def index1(): 阅读全文
posted @ 2020-09-23 22:10 PythonNew_Mr.Wang 阅读(154) 评论(0) 推荐(0) 编辑
摘要:# 不加返回值from flask import Flask from flask import abort app = Flask(__name__) # 在第一次请求之前调用,可以在此方法内部做一些初始化操作 @app.before_first_request def before_first_ 阅读全文
posted @ 2020-09-23 17:39 PythonNew_Mr.Wang 阅读(168) 评论(0) 推荐(0) 编辑
摘要:## 后端:import os from flask import request, jsonify from werkzeug.utils import secure_filename from flask import Flask, request import hashlib import t 阅读全文
posted @ 2020-09-23 16:58 PythonNew_Mr.Wang 阅读(199) 评论(0) 推荐(0) 编辑
摘要:1:POST获取JSON请求数据 from flask import Flask, request,jsonify import json app = Flask(__name__) @app.route('/', methods=['POST']) def index(): print(reque 阅读全文
posted @ 2020-09-23 16:03 PythonNew_Mr.Wang 阅读(171) 评论(0) 推荐(0) 编辑
摘要:flask中的配置文件是一个flask.config.Config对象(继承字典),默认配置为: { 'DEBUG': get_debug_flag(default=False), 是否开启Debug模式 'TESTING': False, 是否开启测试模式 'PROPAGATE_EXCEPTION 阅读全文
posted @ 2020-09-23 15:54 PythonNew_Mr.Wang 阅读(202) 评论(0) 推荐(0) 编辑
摘要:def data_sort(data_dict): # 给字段的key排序 data_list_sort = sorted(data_dict.keys()) data_sort={} # 映射对应数值的value for n in data_list_sort: res = data_dict[n 阅读全文
posted @ 2020-09-09 11:39 PythonNew_Mr.Wang 阅读(236) 评论(0) 推荐(0) 编辑
摘要:def counter_mine(ulist): result = {} for value in ulist: if result.get(value)==None: result[value]=1 else: result[value]+=1 return counter_mine if __n 阅读全文
posted @ 2020-09-09 11:13 PythonNew_Mr.Wang 阅读(151) 评论(0) 推荐(0) 编辑
摘要://上传图片 upload() { var that=this uni.chooseImage({ count: 6, //默认9 sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有 sourceType: ['album'], / 阅读全文
posted @ 2020-09-04 10:28 PythonNew_Mr.Wang 阅读(450) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示