For example, I have a class-based view that allows you to use both the GET and POST method, as shown below,
class ViewOne(View): def post(self, request, *args, **kwargs): ... def get(self, request, *args, **kwargs): ... @method_decorator(login_required) def dispatch(self, *args, **kwargs): return super(ViewOne, self).dispatch(*args, **kwargs)
Now, both GET and POST are login_required. But what if I want only POST to be login_required?
yejinxin
source share