@register.inclusion_tag(u'generic/includes/disqus_sso.html', takes_context=True)
def disqus_sso_script(context):
 settings = context[u'settings']
 public_key = getattr(settings, u'COMMENTS_DISQUS_API_PUBLIC_KEY', u'')
 secret_key = getattr(settings, u'COMMENTS_DISQUS_API_SECRET_KEY', u'')
 user = context[u'request'].user
 if (public_key and secret_key and user.is_authenticated()):
  context[u'public_key'] = public_key
  context[u'sso_data'] = _get_disqus_sso(user, public_key, secret_key)
 return context

@ register . inclusion_tag ( u'generic/includes/disqus_sso.html' , takes_context = True ) def disqus_sso_script ( context ) : settings = context [ u'settings' ] public_key = getattr ( settings , u'COMMENTS_DISQUS_API_PUBLIC_KEY' , u'' ) secret_key = getattr ( settings , u'COMMENTS_DISQUS_API_SECRET_KEY' , u'' ) user = context [ u'request' ] . user if ( public_key and secret_key and user . is_authenticated ( ) ) : context [ u'public_key' ] = public_key context [ u'sso_data' ] = _get_disqus_sso ( user , public_key , secret_key ) return context
provides a generic context variable which adds single-sign-on support to disqus if comments_disqus_api_public_key and comments_disqus_api_secret_key are specified .