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.
This is a very late answer, but I had exactly the same problem. Turns out we hadn't turned off the apache Basic Authentication on our server (which was in place during development). PayPal can't get through that authentication layer, so gets a 403 in response. It could have been another issue, but this was certainly our problem!