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])
In my
INSTALLED_APPS
, my_app is not specified as simply asmy_app
but rather asmy_app.apps.MyAppConfig
. ~My tasks are located atmy_app.tasks
butautodiscover()
looks for them atmy_app.apps.MyAppConfig.tasks
because of how it iterates overINSTALLED_APPS
.~autodiscover
tries toimport_module('my_app.apps.MyAppConfig')
and fails because MyAppConfig is not a module. I don't know enough about AppConfigs orINSTALLED_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])