2020-03-06CBV与FBV

CBV一个路由对应一个类

urls.py

path('路由',类名.as_view())

views.py

from django.views import View
class Login(View):
    def get(self,request):
          return ...
     def post(self,request):
          return ...

FBV一个路由对应一个方法

你可能感兴趣的:(2020-03-06CBV与FBV)