def get_url():
    return reverse('openid-provider-xrds')

def openid_meta(request):
    context = {
        'openid_server': context['request'].build_absolute_uri(get_url())
    }
    content = '''<meta http-equiv="X-XRDS-Location" content="%(openid_server)s"/>
    <meta http-equiv="X-YADIS-Location" content="%(openid_server)s" />
''' % context
    return { 'openid_meta': context }

from django.core.urlresolvers import reverse

def get_url():
    return reverse('openid-provider-xrds')

def openid_meta(request):
    context = {
        'openid_server': request.build_absolute_uri(get_url())
    }
    content = '''<meta http-equiv="X-XRDS-Location" content="%(openid_server)s"/>
    <meta http-equiv="X-YADIS-Location" content="%(openid_server)s" />
''' % context
    return { 'openid_meta': content }

Remove dependency on openid in the base template (bis)
Remove dependency on openid in the base template (bis)

Fixes #1357

+ from django.core.urlresolvers import reverse
+ 
  def get_url():
      return reverse('openid-provider-xrds')
  
  def openid_meta(request):
      context = {
-         'openid_server': context['request'].build_absolute_uri(get_url())
+         'openid_server': request.build_absolute_uri(get_url())
      }
      content = '''<meta http-equiv="X-XRDS-Location" content="%(openid_server)s"/>
      <meta http-equiv="X-YADIS-Location" content="%(openid_server)s" />
  ''' % context
-     return { 'openid_meta': context }
+     return { 'openid_meta': content }
  
Remove dependency on openid in the base template (bis)
## Code Before:
def get_url():
    return reverse('openid-provider-xrds')

def openid_meta(request):
    context = {
        'openid_server': context['request'].build_absolute_uri(get_url())
    }
    content = '''<meta http-equiv="X-XRDS-Location" content="%(openid_server)s"/>
    <meta http-equiv="X-YADIS-Location" content="%(openid_server)s" />
''' % context
    return { 'openid_meta': context }

## Instruction:
Remove dependency on openid in the base template (bis)
## Code After:
from django.core.urlresolvers import reverse

def get_url():
    return reverse('openid-provider-xrds')

def openid_meta(request):
    context = {
        'openid_server': request.build_absolute_uri(get_url())
    }
    content = '''<meta http-equiv="X-XRDS-Location" content="%(openid_server)s"/>
    <meta http-equiv="X-YADIS-Location" content="%(openid_server)s" />
''' % context
    return { 'openid_meta': content }
