#NEWLINE# def post_view( request ) : #NEWLINE# #INDENT# 'A view that expects a POST, and returns a different template depending\n    on whether any POST data is available\n    ' #NEWLINE# if ( request . method == 'POST' ) : #NEWLINE# #INDENT# if request . POST : #NEWLINE# #INDENT# t = Template ( 'Data received: {{ data }} is the value.' , name = 'POST Template' ) #NEWLINE# c = Context ( { #NEWLINE# #INDENT# 'data' : request . POST [ 'value' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# t = Template ( 'Viewing POST page.' , name = 'Empty POST Template' ) #NEWLINE# c = Context ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# t = Template ( 'Viewing GET page.' , name = 'Empty GET Template' ) #NEWLINE# c = Context ( ) #NEWLINE# #UNINDENT# return HttpResponse ( t . render ( c ) )