@cache_page(XDOMAIN_PROXY_CACHE_TIMEOUT)
def xdomain_proxy(request):
 config = XDomainProxyConfiguration.current()
 if (not config.enabled):
  return HttpResponseNotFound()
 allowed_domains = []
 for domain in config.whitelist.split('\n'):
  if domain.strip():
   allowed_domains.append(domain.strip())
 if (not allowed_domains):
  log.warning(u'No whitelist configured for cross-domain proxy. You can configure the whitelist in Django Admin using the XDomainProxyConfiguration model.')
  return HttpResponseNotFound()
 context = {'xdomain_masters': json.dumps({domain: '*' for domain in allowed_domains})}
 return render_to_response('cors_csrf/xdomain_proxy.html', context)

@ cache_page ( XDOMAIN_PROXY_CACHE_TIMEOUT ) def xdomain_proxy ( request ) : config = XDomainProxyConfiguration . current ( ) if ( not config . enabled ) : return HttpResponseNotFound ( ) allowed_domains = [ ] for domain in config . whitelist . split ( '\n' ) : if domain . strip ( ) : allowed_domains . append ( domain . strip ( ) ) if ( not allowed_domains ) : log . warning ( u'No whitelist configured for cross-domain proxy. You can configure the whitelist in Django Admin using the XDomainProxyConfiguration model.' ) return HttpResponseNotFound ( ) context = { 'xdomain_masters' : json . dumps ( { domain : '*' for domain in allowed_domains } ) } return render_to_response ( 'cors_csrf/xdomain_proxy.html' , context )
serve the xdomain proxy page .