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)#打印一下当前访问的路径