#NEWLINE# @ method_decorator ( login_required ) #NEWLINE# def login_protected_view( self , request ) : #NEWLINE# #INDENT# t = Template ( 'This is a login protected test using a method. Username is {{ user.username }}.' , name = 'Login Method Template' ) #NEWLINE# c = Context ( { #NEWLINE# #INDENT# 'user' : request . user , #NEWLINE# #UNINDENT# } ) #NEWLINE# return HttpResponse ( t . render ( c ) )