django-paypal无法处理通知信号

时间:2017-03-18 01:43:23

标签: python django paypal django-paypal

我使用django标准ipn并且无法处理通知信号。 付款顺利进行只有通知部分不起作用。 这是我的signals.py

def show_me_the_money(sender, **kwargs):
    ipn_obj = sender
    if ipn_obj.payment_status == ST_PP_COMPLETED:
        print("yey")
        order = Orders.objects.get(id=38)
        order.paid = True
        order.save()

valid_ipn_received.connect(show_me_the_money)

apps.py

class PaymentConfig(AppConfig):
    name = 'payment'
    verbose_name = 'Payment'


    def ready(self):
        import payment.signals

初始化的.py

default_app_config = 'payment.apps.PaymentConfig'

urls.py

url(r'^payment/', include('payment.urls', namespace='payment')),

1 个答案:

答案 0 :(得分:0)

转到settings / base.py或settings.py并插入ALLOWED_HOSTS您的DNS,或者如果您没有任何问题,可以使用ALLOWED_HOSTS ='*'