Skip to content
This repository has been archived by the owner on Feb 27, 2021. It is now read-only.

Tasks are not autodiscovered when using explicit AppConfig in INSTALLED_APPS #26

Open
unformatt opened this issue Feb 13, 2019 · 1 comment

Comments

@unformatt
Copy link

unformatt commented Feb 13, 2019

In my INSTALLED_APPS, my_app is not specified as simply as my_app but rather as my_app.apps.MyAppConfig. My tasks are located at my_app.tasks but autodiscover() looks for them at my_app.apps.MyAppConfig.tasks because of how it iterates over INSTALLED_APPS.

autodiscover tries to import_module('my_app.apps.MyAppConfig') and fails because MyAppConfig is not a module. I don't know enough about AppConfigs or INSTALLED_APPS to know if it's a reasonable fix to assume the first part of the path is always an app e.g. import_module(app.split('.')[0])

@unformatt unformatt changed the title Tasks are not autodiscovered when using explicit AppConfig Tasks are not autodiscovered when using explicit AppConfig in INSTALLED_APPS Feb 13, 2019
@ruben-mv
Copy link

provisional solution here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants