上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 18 下一页
摘要: def generate_qrcode(request): data = 'hello' img = qrcode.make(data) buf = io.BytesIO() img.save(buf) image_stream = buf.getvalue() response = HttpRes 阅读全文
posted @ 2022-12-26 17:13 乐乐乐乐乐乐樂 阅读(37) 评论(0) 推荐(0)
摘要: import urllib.parse import requests #调用机器人接口 def qingyunke(msg): url = "http://api.qingyunke.com/api.php?key=free&appid=0&msg=%s" % (urllib.parse.quot 阅读全文
posted @ 2022-12-23 09:22 乐乐乐乐乐乐樂 阅读(46) 评论(0) 推荐(0)
摘要: import jwt #加密 encode_jwt = jwt.encode({'uid':'123'},'123',algorithm='HS256') print(encode_jwt) #解密 #强转 encode_jwt = str(encode_jwt) decode_jwt = jwt. 阅读全文
posted @ 2022-12-23 09:14 乐乐乐乐乐乐樂 阅读(127) 评论(0) 推荐(0)
摘要: import requests import hashlib #测试文件上传 files = {'file':('touxiang.png',open('c:/touxiang.png','rb'))} res = requests.post('http://localhost:8000/uploa 阅读全文
posted @ 2022-12-23 09:05 乐乐乐乐乐乐樂 阅读(25) 评论(0) 推荐(0)
摘要: postman-postman增加断言 我们在做测试的时候都会有一个验证点,我们通常把这个验证点叫做断言,断言通过了就会说明我们的这个用例是通过的,当然这么强大的postman也是有断言的,我们一起学习下如何通过postman增加断言。 断言介绍 断言是编程术语,表示为一些布尔表达式。其实说白了就是 阅读全文
posted @ 2022-12-22 17:44 乐乐乐乐乐乐樂 阅读(96) 评论(0) 推荐(0)
摘要: 路由 path(r'^export/xls/$', views.export_excel, name='export_excel'), 函数 import xlwt from django.http import HttpResponse from django.contrib.auth.model 阅读全文
posted @ 2022-12-22 16:21 乐乐乐乐乐乐樂 阅读(67) 评论(0) 推荐(0)
摘要: import random #导入绘图库 from PIL import ImageDraw #导入绘图字体库 from PIL import ImageFont #导入图片库 from PIL import Image #导入io库 import io import time #定义验证码类 cl 阅读全文
posted @ 2022-12-22 14:09 乐乐乐乐乐乐樂 阅读(41) 评论(0) 推荐(0)
摘要: 增删改查。配置对应路由,函数,视图。报错注意看控制台。 添加取到前台传来的参数,后端给予验证。入库 编辑,取到当前编辑得id,在后台查到对应数据。重新update 删除,取到当前点击ID,后台delete 添加 views.py #添加数据 class Index(APIView): def get 阅读全文
posted @ 2022-12-22 13:56 乐乐乐乐乐乐樂 阅读(44) 评论(0) 推荐(0)
摘要: Django使用locals()函数 locals()函数会以字典类型返回当前位置的全部局部变量 在 views.py中添加 #展示 class Goods_list(View): def get(self, request): goods = Goods.objects.all() return 阅读全文
posted @ 2022-12-22 10:35 乐乐乐乐乐乐樂 阅读(62) 评论(0) 推荐(0)
摘要: 创建项目 django-admin startproject web cd web python manage.py startapp weblist 生成迁移文件 python manage.py makemigrations 生成迁移数据 python manage.py migrate 运行 阅读全文
posted @ 2022-12-20 15:49 乐乐乐乐乐乐樂 阅读(19) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 18 下一页
jQuery火箭图标返回顶部代码