def saml_metadata_view(request):
 if (not SAMLConfiguration.is_enabled(request.site)):
  raise Http404
 complete_url = reverse('social:complete', args=('tpa-saml',))
 if (settings.APPEND_SLASH and (not complete_url.endswith('/'))):
  complete_url = (complete_url + '/')
 saml_backend = load_backend(load_strategy(request), 'tpa-saml', redirect_uri=complete_url)
 (metadata, errors) = saml_backend.generate_metadata_xml()
 if (not errors):
  return HttpResponse(content=metadata, content_type='text/xml')
 return HttpResponseServerError(content=', '.join(errors))

def saml_metadata_view ( request ) : if ( not SAMLConfiguration . is_enabled ( request . site ) ) : raise Http404 complete_url = reverse ( 'social:complete' , args = ( 'tpa-saml' , ) ) if ( settings . APPEND_SLASH and ( not complete_url . endswith ( '/' ) ) ) : complete_url = ( complete_url + '/' ) saml_backend = load_backend ( load_strategy ( request ) , 'tpa-saml' , redirect_uri = complete_url ) ( metadata , errors ) = saml_backend . generate_metadata_xml ( ) if ( not errors ) : return HttpResponse ( content = metadata , content_type = 'text/xml' ) return HttpResponseServerError ( content = ', ' . join ( errors ) )
get the service provider metadata for this edx-platform instance .