@classmethod<EOL><INDENT>def as_view(cls, **initkwargs):<DEDENT>
<EOL>for key in initkwargs:<EOL><INDENT>if key in cls.http_method_names:<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>% (key, cls.__name__))<EOL><DEDENT>if not hasattr(cls, key):<EOL><INDENT>raise TypeError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % (<EOL>cls.__name__, key))<EOL><DEDENT><DEDENT>def view(request, *args, **kwargs):<EOL><INDENT>self = cls(**initkwargs)<EOL>if hasattr(self, '<STR_LIT>') and not hasattr(self, '<STR_LIT>'):<EOL><INDENT>self.head = self.get<EOL><DEDENT>self.request = request<EOL>self.args = args<EOL>self.kwargs = kwargs<EOL>self.authed_view = initkwargs.get('<STR_LIT>')<EOL>self.authed_view_kwargs = initkwargs.get('<STR_LIT>')<EOL>self.anonymous_view = initkwargs.get('<STR_LIT>')<EOL>self.anonymous_view_kwargs = initkwargs.get(<EOL>'<STR_LIT>')<EOL>return self.dispatch(request, *args, **kwargs)<EOL><DEDENT>update_wrapper(view, cls, updated=())<EOL>update_wrapper(view, cls.dispatch, assigned=())<EOL>return view<EOL>
Main entry point for a request-response process.