上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 30 下一页
摘要: form表单action参数 1.不写 默认朝当前所在的url提交数据 2.全写 指名道姓 3.只写后缀 /login/ 阅读全文
posted @ 2022-04-03 18:49 咖喱给给啊 阅读(147) 评论(0) 推荐(0)
摘要: from django.shortcuts import HttpResponse,render,redirect #返回字符串 return HttpResponse('字符串') #返回html页面 return render(request,'login.html') def ab_rende 阅读全文
posted @ 2022-04-03 17:59 咖喱给给啊 阅读(25) 评论(0) 推荐(0)
摘要: # 静态文件配置 STATICFILES_DIRS = [ os.path.join(BASE_DIR,'static'), os.path.join(BASE_DIR,'static1'), os.path.join(BASE_DIR,'static2'), ] # 静态文件动态解析 {% loa 阅读全文
posted @ 2022-04-03 17:55 咖喱给给啊 阅读(110) 评论(0) 推荐(0)
摘要: url控制:三种:-最原始的-半自动(必须继承ViewSetMixin)-url(r'^books/$', views.Book.as_view({'get':'get_all'})),-全自动(自动生成路由,必须继承自ModelViewSet)(不建议用) -半自动(必须继承ViewSetMixi 阅读全文
posted @ 2022-03-27 21:49 咖喱给给啊 阅读(44) 评论(0) 推荐(0)
摘要: 换镜像地址 npm config set registry http://registry.npmjs.org 然后在创建 阅读全文
posted @ 2022-03-26 04:47 咖喱给给啊 阅读(66) 评论(0) 推荐(0)
摘要: 如果现在是taobao的镜像 npm config set registry http://registry.cnpmjs.org/如果不是淘宝的镜像 npm config set registry https://registry.npm.taobao.org 先在CMD中运行这个 npm con 阅读全文
posted @ 2022-03-26 02:43 咖喱给给啊 阅读(192) 评论(0) 推荐(0)
摘要: # 查所有,才需要分页 from rest_framework.generics import ListAPIView # 内置三种分页方式 from rest_framework.pagination import PageNumberPagination,LimitOffsetPaginatio 阅读全文
posted @ 2022-03-25 19:27 咖喱给给啊 阅读(40) 评论(0) 推荐(0)
摘要: 批量查询: def get(self,request,*args,**kwargs): # 查一个 pk = kwargs.get('pk') if pk: book_list = models.Book.objects.filter(pk=pk).first() book_list_ser = B 阅读全文
posted @ 2022-03-25 18:08 咖喱给给啊 阅读(67) 评论(0) 推荐(0)
摘要: def func(): ll = [] i = 0 while True: i = i + 1 # res = yield ll res = yield ll.append(i) print(' ',res) g = func() #第一次执行的时候程序正常执行,直到遇到yield,在执行yield 阅读全文
posted @ 2022-03-24 21:56 咖喱给给啊 阅读(54) 评论(0) 推荐(0)
摘要: import jwt from rest_framework_jwt.authentication import BaseAuthentication,BaseJSONWebTokenAuthentication from rest_framework.exceptions import Authe 阅读全文
posted @ 2022-03-23 22:52 咖喱给给啊 阅读(71) 评论(0) 推荐(0)
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 30 下一页