title: Flask gateway equlivent in Django
body: <p>I'm setting up my <strong>Braintree</strong> web-hooks in <strong>Django</strong>, as Braintree <a href="https://developer.paypal.com/braintree/docs/guides/webhooks/parse/python" rel="nofollow noreferrer">docs</a> says i have to add this method</p>
  <pre><code>from flask import Flask, request, render_template, Response
  ...
  def webhook():
      webhook_notification = gateway.webhook_notification.parse(str(request.form['bt_signature']), request.form['bt_payload'])
  
      # Example values for webhook notification properties
      print(webhook_notification.kind)
      print(webhook_notification.timestamp) 
  
      return Response(status=200)
  </code></pre>
  <p>everything is ok except i have no idea what <strong>gateway</strong> is, and I'm getting <em>undefined name error</em></p>
  <p>my Django code</p>
  <pre><code>@csrf_exempt
  def webhook(request):
      print(&quot;post:: &quot;, request.POST)
  
      webhook_notification = gateway.webhook_notification.parse(str(request.form[&quot;bt_signature&quot;]), request.form[&quot;bt_payload&quot;])
      
      print(webhook_notification.kind)
      print(webhook_notification.timestamp)
  
      return HttpResponse(&quot;Ok&quot;)
  
  </code></pre>
  <p>sorry if missed up things, I haven't try <strong>flask</strong> yet.</p>