上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 22 下一页
1:构建一个接口 import uvicorn from fastapi import FastAPI app = FastAPI() """ 构建接口 """ @app.get("/") async def Index(): return {"code":200,"msg":"访问成功"} if Read More
posted @ 2022-09-13 12:35 PythonNew_Mr.Wang Views(538) Comments(0) Diggs(0)
1:目录结构 2:配置sqlalchemy参数文件 : config.py # config.py from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sq Read More
posted @ 2022-09-13 02:37 PythonNew_Mr.Wang Views(432) Comments(0) Diggs(0)
1:基础理解异步如何实现的 # 请记住async创建的对象一定是coroutine对象 async def func(name): res = random.randint(1,10) print("{}需要{}秒".format(name,res)) # await 后面一定是coroutine对 Read More
posted @ 2022-09-09 16:33 PythonNew_Mr.Wang Views(192) Comments(0) Diggs(0)
1:继承后台首页的模板,找到需要修改的部分。 文件位置: templates/admin/home.html {% block 你的继承负名 %} <el-card style="margin-top: 10px;"> <iframe style="width: 100%;height: 410px Read More
posted @ 2022-07-26 20:29 PythonNew_Mr.Wang Views(292) Comments(0) Diggs(0)
```python from selenium.webdriver.common.action_chains import ActionChains from selenium import webdriver from PIL import Image web = webdriver.Chrome Read More
posted @ 2022-07-20 15:05 PythonNew_Mr.Wang Views(715) Comments(0) Diggs(0)
UPDATE "main"."auth_permission" SET "content_type_id" = 1, "name" = 'Can add 日志记录' WHERE "codename" = 'add_logentry'; UPDATE "main"."auth_permission" Read More
posted @ 2022-07-18 00:44 PythonNew_Mr.Wang Views(71) Comments(0) Diggs(0)
```python class UserInfo(models.Model): # 设计表设计略过。。。。 def __str__(self): return self.name class Meta: verbose_name = "客户信息" # admin的显示,分组权限的中文显示 verbo Read More
posted @ 2022-07-17 16:48 PythonNew_Mr.Wang Views(67) Comments(0) Diggs(0)
# 重写 修改、添加 def save_model(self, request, obj, form, change): if change: """ 重写 修改按钮 """ super().save_model(request, obj, form, change) UserInfo.object Read More
posted @ 2022-07-17 13:24 PythonNew_Mr.Wang Views(321) Comments(0) Diggs(0)
# 请求到验证码base64编码 json_img_data = json_raw.get("Vimage") # 获取到验证码编码 # 保存验证码图片到本地 def base64_to_img(bstr, file_path): imgdata = base64.b64decode(bstr) f Read More
posted @ 2022-07-12 19:01 PythonNew_Mr.Wang Views(1685) Comments(0) Diggs(0)
声明:继承AbstractUser是可以的,但是继承分组扩展会影响到权限分配问题,所以分组扩展推荐使用外键关联 # 自定义下的 models.pyfrom django.contrib.auth.models import AbstractUser,Group,Permission # 这里也可以扩 Read More
posted @ 2022-07-08 01:15 PythonNew_Mr.Wang Views(591) Comments(0) Diggs(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 22 下一页