code: def disqus_sso(context):
      
  
      DISQUS_SECRET_KEY = getattr(settings, 'DISQUS_SECRET_KEY', None)
      if DISQUS_SECRET_KEY is None:
          return "<p>You need to set DISQUS_SECRET_KEY before you can use SSO</p>"
  
      DISQUS_PUBLIC_KEY = getattr(settings, 'DISQUS_PUBLIC_KEY', None)
      if DISQUS_PUBLIC_KEY is None:
          return "<p>You need to set DISQUS_PUBLIC_KEY before you can use SSO</p>"
  
      user = context['user']
  
      if user.is_anonymous():
          return ""
  
      # create a JSON packet of our data attributes
      data = json.dumps({
          'id': user.id,
          'username': user.username,
          'email': user.email,
      })
  
      # encode the data to base64
      message = base64.b64encode(data.encode('utf-8'))
  
      # generate a timestamp for signing the message
      timestamp = int(time.time())
  
      key = DISQUS_SECRET_KEY.encode('utf-8')
      msg = ('%s %s' % (message, timestamp)).encode('utf-8')
      digestmod = hashlib.sha1
  
      # generate our hmac signature
      sig = hmac.HMAC(key, msg, digestmod).hexdigest()
  
      return  dict(
          message=message,
          timestamp=timestamp,
          sig=sig,
          pub_key=DISQUS_PUBLIC_KEY,
      )
docs: Return the HTML/js code to enable DISQUS SSO - so logged in users on
      your site can be logged in to disqus seemlessly.