Django post save signal getting called twice despite uid

前端 未结 4 1504
[愿得一人]
[愿得一人] 2020-12-16 21:59

I have registered my signal with the callback using the @receiver decorator

@receiver(post_save, sender=User, dispatch_uid=\'ARandomUniqueString         


        
4条回答
  •  旧巷少年郎
    2020-12-16 22:37

    I have put the from app.signals import * code in __init__.py

    You should not put anything in your __init__.py file.

    If you remove this from __init__.py, and add it to the bottom of your models.py, it should solve your problem.

    You should also avoid "blind" imports from foo import *

提交回复
热议问题