会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
一枚码农
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
6
7
8
9
10
11
12
下一页
2022年4月17日
docker 简单使用
摘要: 参考文档: https://docker.easydoc.net/doc/81170005/cCewZWoN/lTKfePfP 测试项目目录 Dockerfile 文件 点击查看代码 # 建立python环境 FROM python:3.10 # 镜像作者 MAINTAINER Along # 设置
阅读全文
posted @ 2022-04-17 16:16 一枚码农
阅读(61)
评论(0)
推荐(0)
2022年3月31日
bfs&dfs
摘要: 如下图 bfs代码 点击查看代码 """ bfs算法: 存储:将每个节点的相邻节点用key:value的形式存在字典中 遍历:从起点开始,先把起点(key)的值(value)取出,然后检查取出的值是否已经被执行过,没有则继续取(key)出其值(value)执行前边的步骤 """ graph = {
阅读全文
posted @ 2022-03-31 22:51 一枚码农
阅读(37)
评论(0)
推荐(0)
2022年3月28日
django使用celery
摘要: 安装包 pip install celery==5.1.2 使用 官方文档:https://docs.celeryq.dev/en/stable/django/first-steps-with-django.html 1.创建django项目,在项目与settings.py同级的的目录下创建cele
阅读全文
posted @ 2022-03-28 15:28 一枚码农
阅读(1015)
评论(0)
推荐(0)
2022年3月24日
requests 封装, http
摘要: #### 封装 点击查看代码 ``` import functools import traceback from django_redis import get_redis_connection from requests.adapters import HTTPAdapter import re
阅读全文
posted @ 2022-03-24 11:02 一枚码农
阅读(97)
评论(0)
推荐(0)
2022年3月19日
django模型类查询结果转字典以及时间格式化
摘要: 模型类及数据 点击查看代码 from django.db import models from django.utils.translation import gettext_lazy as _ # Create your models here. class HeroInfo(models.Mod
阅读全文
posted @ 2022-03-19 16:45 一枚码农
阅读(971)
评论(0)
推荐(0)
2022年3月17日
django 分页
摘要: 点击查看代码 from django.views import View from django.forms.models import model_to_dict from django.core.paginator import Paginator, EmptyPage, PageNotAnIn
阅读全文
posted @ 2022-03-17 15:37 一枚码农
阅读(82)
评论(0)
推荐(0)
2022年3月13日
python 虚拟环境
摘要: 1.安装 pip install virtualenv 2.创建虚拟环境 进入存放虚拟环境的目录,执行以下命令。(如:D:\venv) virtualenv myvenv(虚拟环境名称) 创建虚拟环境的时候还可以指定Python解释器,如virtualenv -p XXX\python.exe [v
阅读全文
posted @ 2022-03-13 14:39 一枚码农
阅读(88)
评论(0)
推荐(0)
2022年3月9日
使用drf_yasg生成drf接口文档 会有参数类型,比drf自己的更完善
摘要: 1.安装库 **pip install drf-yasg** 2.配置setting INSTALLED_APPS = [ ... 'drf_yasg', ... ] 3.配置全局路由文件urls.py 点击查看代码 from drf_yasg.views import get_schema_vie
阅读全文
posted @ 2022-03-09 18:23 一枚码农
阅读(1281)
评论(1)
推荐(1)
DRF api文档自动生成
摘要: 转自:https://www.cnblogs.com/alantammm/p/15214853.html 字段描述 是 来源于 模型类中字段的 help_text 的值.(name = models.CharField(_('名称'), max_length=128, help_text='名称')
阅读全文
posted @ 2022-03-09 16:17 一枚码农
阅读(77)
评论(0)
推荐(0)
使用jsonschema进行参数校验
摘要: 1.安装jsonschema **pip install jsonschema** 2.代码 点击查看代码 from jsonschema import validate def verify_code_2_member(data: dict): schema = { "type": "object
阅读全文
posted @ 2022-03-09 15:57 一枚码农
阅读(157)
评论(0)
推荐(0)
上一页
1
···
6
7
8
9
10
11
12
下一页
公告