old_contents: import hashlib
  import hmac
  import json
  
  from django.http import HttpResponse
  from django.views.decorators.csrf import csrf_exempt
  from django.views.generic import View
  
  import settings
  from corehq.apps.analytics.tasks import track_clicked_deploy_on_hubspot, track_job_candidate_on_hubspot
  from corehq.apps.analytics.utils import get_meta
  
  
  class HubspotClickDeployView(View):
      urlname = 'hubspot_click_deploy'
  
      def post(self, request, *args, **kwargs):
          meta = get_meta(request)
          track_clicked_deploy_on_hubspot.delay(request.couch_user, request.COOKIES, meta)
          return HttpResponse()
  
  
  class GreenhouseCandidateView(View):
      urlname = 'greenhouse_candidate'
  
      @csrf_exempt
      def dispatch(self, request, *args, **kwargs):
          super(GreenhouseCandidateView, self).dispatch(request=request, args=args, kwargs=kwargs)
  
      def post(self, request, *args, **kwargs):
          digester = hmac.new(settings.GREENHOUSE_API_KEY, request.body, hashlib.sha256)
          calculated_signature = digester.hexdigest()
  
          if hmac.compare_digest(calculated_signature, request.headers.get('HTTP_SIGNATURE', '')):
              body_unicode = request.body.decode('utf-8')
              data = json.loads(body_unicode)
              try:
                  user_emails = data["payload"]["application"]["candidate"]["email_addresses"]
                  for user_email in user_emails:
                      track_job_candidate_on_hubspot.delay(user_email["value"])
              except KeyError:
                  pass
  
          return HttpResponse()
  
new_contents: import hashlib
  import hmac
  import json
  
  from django.http import HttpResponse
  from django.views.decorators.csrf import csrf_exempt
  from django.views.generic import View
  
  import settings
  from corehq.apps.analytics.tasks import track_clicked_deploy_on_hubspot, track_job_candidate_on_hubspot
  from corehq.apps.analytics.utils import get_meta
  
  
  class HubspotClickDeployView(View):
      urlname = 'hubspot_click_deploy'
  
      def post(self, request, *args, **kwargs):
          meta = get_meta(request)
          track_clicked_deploy_on_hubspot.delay(request.couch_user, request.COOKIES, meta)
          return HttpResponse()
  
  
  class GreenhouseCandidateView(View):
      urlname = 'greenhouse_candidate'
  
      @csrf_exempt
      def dispatch(self, request, *args, **kwargs):
          super(GreenhouseCandidateView, self).dispatch(request=request, args=args, kwargs=kwargs)
  
      def post(self, request, *args, **kwargs):
          digester = hmac.new(settings.GREENHOUSE_API_KEY, request.body, hashlib.sha256)
          calculated_signature = digester.hexdigest()
  
          if str(calculated_signature) == str(request.headers.get('HTTP_SIGNATURE', '')):
              body_unicode = request.body.decode('utf-8')
              data = json.loads(body_unicode)
              try:
                  user_emails = data["payload"]["application"]["candidate"]["email_addresses"]
                  for user_email in user_emails:
                      track_job_candidate_on_hubspot.delay(user_email["value"])
              except KeyError:
                  pass
  
          return HttpResponse()
  
subject: fix issue with unsupported method in python < 2.7.7