How to receive and manipulate a bip 70 payment object in django python? I'm trying to check to see if the variables are being set correctly by the client and being received correctly by me.
I'm new to proto buffs and django and my code below doesn't seem to be working.
I'm using bitcoin 0.9
I'm trying to capture a refund address.

In views:

from project import payments_pb2
def protoresponse(request):
    xpo = payments_pb2.Payment.ParseFromString(request)
    returnaddress = xpo.refund_to
    transactions = xpo.transactions
    memo = xpo.memo

    xpa = payments_pb2.PaymentACK
    xpa.payment = xpo.SerializeToString()
    xpa.memo = 'success'
    return HttpResponse(xpa.SerializeToString(), content_type="application/octet-stream")


Any pointers would be greatly appreciated :)
I asked this same question in a simpler way without mentioning bip 70 and got the answer here.
The initial problem was that Django doesn't like people posting to your server who arent authorised so I used from django.views.decorators.csrf import csrf_exempt and the corresponding decorator @csrf_exempt as a short term work around for further debugging.
More detailed info can be found by following the link to the simplified question.