You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where should this code live?
Strictly speaking, signal handling and registration code can live anywhere you like, although it’s recommended to avoid the application’s root module and its models module to minimize side-effects of importing code.
In practice, signal handlers are usually defined in a signals submodule of the application they relate to. Signal receivers are connected in the ready() method of your application configuration class. If you’re using the receiver() decorator, simply import the signals submodule inside ready().
The text was updated successfully, but these errors were encountered:
Podczas rozwoju aplikacji Django odstąpiono od zalecenia, aby sygnały były rejestrowane w models.py. Teraz należy to robić w app config.
Zobacz na https://docs.djangoproject.com/en/1.11/topics/signals/ :
The text was updated successfully, but these errors were encountered: