def csrf(request):
 def _get_val():
  token = get_token(request)
  if (token is None):
   return 'NOTPROVIDED'
  else:
   return force_text(token)
 return {'csrf_token': SimpleLazyObject(_get_val)}

def csrf ( request ) : def _get_val ( ) : token = get_token ( request ) if ( token is None ) : return 'NOTPROVIDED' else : return force_text ( token ) return { 'csrf_token' : SimpleLazyObject ( _get_val ) }
context processor that provides a csrf token .