FBV与CBV及上传文件示例
作者:互联网
FBV:基于函数视图
CBV:基于类视图
urls.py
url('r^add_publisheer/',views.AddPublisher.as_view()),
上传文件示例
views.py
from django.views import View
from django.shortcuts import render,HttpResponse
class AddPublisher(View):
def get(self,request):
pass
def post(self,request):
print(request..path_info)#打印一下当前访问的路径
标签:py,FBV,views,self,示例,request,视图,CBV 来源: https://blog.51cto.com/yht1990/2406545