def set_session_view(request):
 request.session['session_var'] = 'YES'
 return HttpResponse('set_session')

def set_session_view ( request ) : request . session [ 'session_var' ] = 'YES' return HttpResponse ( 'set_session' )
a view that sets a session variable .