随笔分类 -  drf

摘要: 阅读全文
posted @ 2022-09-30 11:31 Sherwin_szw 阅读(11) 评论(0) 推荐(0) 编辑
摘要:路由 urlpatterns = [ path('order/', views.OrderView.as_view()), ] 视图关系 class View(object): @classonlymethod def as_view(cls, **initkwargs): def view(req 阅读全文
posted @ 2022-09-30 10:11 Sherwin_szw 阅读(15) 评论(0) 推荐(0) 编辑
摘要:报错 Model class django.contrib.contenttypes.models.ContentType doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS. 原因 阅读全文
posted @ 2022-09-29 17:38 Sherwin_szw 阅读(84) 评论(0) 推荐(0) 编辑
摘要:django的request对象 request.method request.GET request.POST request.body request.FILES drf中的request参数,又一层封装 request._request.GET request._request.POST re 阅读全文
posted @ 2022-09-29 16:13 Sherwin_szw 阅读(43) 评论(0) 推荐(0) 编辑
摘要:路由 urlpatterns = [ path('login/', views.LoginView.as_view()), path('login2/', views.login2), ] 视图 from django.views import View from django.http impor 阅读全文
posted @ 2022-09-29 11:39 Sherwin_szw 阅读(16) 评论(0) 推荐(0) 编辑
摘要:安装 pip install djangorestframework 注册 INSTALLED_APPS = [ "rest_framework", ] 配置路由 urlpatterns = [ path('auth/', views.auth), path('login2/', views.log 阅读全文
posted @ 2022-09-29 11:18 Sherwin_szw 阅读(39) 评论(0) 推荐(0) 编辑
摘要:django 后端逻辑 def transaction_add(request, pk): res_code = ResCode() if request.method == 'POST': form = TransactionForm(data=request.POST) if not form. 阅读全文
posted @ 2022-09-17 18:27 Sherwin_szw 阅读(36) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示
🚀
回顶
收起
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.