Mercurial > public > sg101
comparison gpp/donations/views.py @ 238:a3b47d0f4df1
Exempt the Paypal IPN view from CSRF protection for #91.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 12 Sep 2010 04:04:42 +0000 |
parents | 9fabeabd89d4 |
children | 767cedc7d12a |
comparison
equal
deleted
inserted
replaced
237:1085dc38399e | 238:a3b47d0f4df1 |
---|---|
10 from django.conf import settings | 10 from django.conf import settings |
11 from django.contrib.sites.models import Site | 11 from django.contrib.sites.models import Site |
12 from django.http import HttpResponse | 12 from django.http import HttpResponse |
13 from django.http import HttpResponseServerError | 13 from django.http import HttpResponseServerError |
14 from django.contrib.auth.models import User | 14 from django.contrib.auth.models import User |
15 from django.views.decorators.csrf import csrf_exempt | |
16 | |
15 | 17 |
16 from donations.models import Donation | 18 from donations.models import Donation |
17 | 19 |
18 PP_DATE_FMT = '%H:%M:%S %b %d, %Y' | 20 PP_DATE_FMT = '%H:%M:%S %b %d, %Y' |
19 | 21 |
53 'domain': current_site.domain, | 55 'domain': current_site.domain, |
54 }, | 56 }, |
55 context_instance = RequestContext(request)) | 57 context_instance = RequestContext(request)) |
56 | 58 |
57 | 59 |
60 @csrf_exempt | |
58 def ipn(request): | 61 def ipn(request): |
59 """ | 62 """ |
60 This function is the IPN listener and handles the IPN POST from Paypal. | 63 This function is the IPN listener and handles the IPN POST from Paypal. |
61 The algorithm here roughly follows the outline described in chapter 2 | 64 The algorithm here roughly follows the outline described in chapter 2 |
62 of Paypal's IPNGuide.pdf "Implementing an IPN Listener". | 65 of Paypal's IPNGuide.pdf "Implementing an IPN Listener". |