Question: I was working on the paypal ipn listener - it didn't seem to be 'hearing' the signals, although the database was updated so I know the ipn was accepted by the paypal.standard.ipn package.

Now I get a 403 error from the ipn simulator - does anyone have any idea why this would happen? When I navigate directly to the listener url there is no error.

I added @csrf\_exempt to the listener, but that didn't help.

Any suggestions are welcome.

Listeners.py:

```
from django.dispatch import receiver
from django.contrib.sites.models import Site

from django.views.decorators.csrf import csrf_exempt
from paypal.standard.ipn import signals as paypal_signals
from messaging import send
from utests.models import Test
 import logging

@csrf_exempt
@receiver(paypal_signals.payment_was_successful)
def payment_was_succesful_listener(sender, **kwargs):
     #:sender is the PayPalIPN model instance
    logging.debug("in payment successful listener")
    ... the rest of the code is commented out while I debug...

@receiver(paypal_signals.payment_was_flagged, dispatch_uid="dl-payment_was_flagged")
def payment_was_flagged_listener(sender, **kwargs):
    #:sender is the PayPalIPN model instance
    pass

```

As you can see, all that is supposed to happen is some debugging, but it doesn't get there.

Answer: 
I just ran into the same issue again. Here is the solution in case anyone else has this problem:

The @csrf\_exempt needs to be added to the django-paypal package itself.

In paypal/standard/ipn/views.py add:

```
from django.views.decorators.csrf import csrf_exempt

```

at the top, among the rest of the imports, and 

```
@csrf_exempt

```

above the @require\_POST above the function declaration.
I had the same issue.
It turns out that in my virtualenv I **have installed** django-paypal and in my project, I had the app **paypal**.
When I add the @csrf\_exempt to my app didn't work, because django always call the paypal package in my Virtualenv.
I did an pip uninstall django-paypal and everything goes well (Another solution maybe is modify the package view)

I hope it helps!