-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subclassing DjangoDramatiqConfig fails as initialization happens on module import first not getting to subclass #100
Comments
@ashleybartlett can you give #103 a try? As far as I can tell, |
@Bogdanp I gave it another try and it works for me. Initially I hit the same error as when I tried to spike this. This time I spent a few more minutes looking at the exception output. Turns out my admin import was causing some task modules to be imported early, which was causing it to register them before django dramatic had configured the broker, I was getting the So I would say this could be a breaking change based on this. |
Yeah, that sounds familiar. I think that may have been the reason for why the config was initialized so soon. I think this might be worth breaking backwards-compatibility for, but I'll have to play around with it more first. |
I think it's worth it, I just wanted to call it out. |
Hi, I'm having some issues related to this. Subclassing the Django configuration was difficult because of the
The error above happens because Django imports app models before running ready(), so I managed to run ready at the
@Bogdanp What do you think about this fix? Could we move the workaround into DjangoDramatiqConfig class? I could make a PR if you're interested. |
I'm trying to subclass
DjangoDramatiqConfig
so I can use theGroupCallbacks
middleware. Unfortunately as there is aDjangoDramatiqConfig.initialize()
call in the base of theapps.py
file which gets called before my one, so it just fails as it doesn't know to pass in the kwargs to the middleware.Have I missed something?
Or is there a reason why a global
initialize()
call is used, and not aDjangoDramatiqConfig.ready()
which is called only slightly later on completion of initialization importing INSTALLED_APPS? ?Happy to throw a PR up to make the change. Or move it to a
__init__()
call. I just don't understand why it's global, with no way to block.The text was updated successfully, but these errors were encountered: