@requires_csrf_token
def permission_denied(request, exception, template_name=ERROR_403_TEMPLATE_NAME):
 try:
  template = loader.get_template(template_name)
 except TemplateDoesNotExist:
  if (template_name != ERROR_403_TEMPLATE_NAME):
   raise
  return http.HttpResponseForbidden('<h1>403 Forbidden</h1>', content_type='text/html')
 return http.HttpResponseForbidden(template.render(request=request, context={'exception': force_text(exception)}))

@ requires_csrf_token def permission_denied ( request , exception , template_name = ERROR_403_TEMPLATE_NAME ) : try : template = loader . get_template ( template_name ) except TemplateDoesNotExist : if ( template_name != ERROR_403_TEMPLATE_NAME ) : raise return http . HttpResponseForbidden ( '<h1>403 Forbidden</h1>' , content_type = 'text/html' ) return http . HttpResponseForbidden ( template . render ( request = request , context = { 'exception' : force_text ( exception ) } ) )
permission denied handler .