Search code examples
djangodjango-rest-frameworkdjango-signals

Django Deprecation: Signals


Will signals be deprecated? I'm starting a new application and I initially planned to implement some signal based functions but a colleague told me that signals are about to be deprecated and that I should refrain from using them. Is that true? I haven't been able to find any sources that support his claim.


Solution

  • but a colleague told me that signals are about to be deprecated and that I should refrain from using them. Is that true?

    That might of course be the case in the (far) future. But the current Django Deprecation Timeline [Django-doc] does not mention this. The only thing with respect to signals that has been removed is the weak parameter in the disconnect function.

    That being said, Django's signals are often used when it is not necessary. Several Django ORM calls, like bulk_create(..) for example circumvent the signals. It thus gives a false idea that some task will be performed when creating new records. see for example this blog post [Lincoln Loop] that explains why signals are often not a good idea.