Hi guys !
First of all, i’m new here, so if this issue has already been discussed or if here is not the place to talk about it (I also opened a forum post) please don’t hesitate to tell me. Also, please be aware English is not my first language.
I would want to discuss about signals and how they are loaded in Django.
Very often, i create my signals.py, write my signal and
wonder for a while why it does not work. Of course, the file is not
imported and so never even read by python !
So i create an apps.py, on this template :
from django.apps import AppConfig
class CustomAppConfig(AppConfig):
name = "app.subapp"
def ready(self):
import app.subapp.signals
I would like to sugest importing signals.py automatically at app loading (maybe django.apps.config.AppConfig.ready() ?)
Pros
apps.py everywhereCons
signals.py
Alternatives
If loading (and so activating) signals is too mush of a change, maybe others solutions will fix my problem. For know, all I can think of :
signals.py file is detected but the AppConfig is not overriden (but we would not know if imported elsewhere)i would like to know if this would benefits others (I think so) and
if it is worthy of filing an Issue (as a developper I may find time to
dev on it if needed)
Looking forward to reading from you,
Roxane Bellot
--
You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAAvJ%2BFzx%3DFZ01BvBhEtH8SOZQA3imM4q3j1FNA7EF6ec1BKrPA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM1%2B-MT4UXH5gAh6fPq1GuGjvC2gmU22VBrbXWONXKquGg%40mail.gmail.com.