Skip to content
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

v1.0.13 Django 1.10 ImportError: No module named 'myapp.apps.MyappsConfig'; 'myapps.apps' is not a package #59

Closed
wangxuepeng opened this issue Aug 22, 2016 · 2 comments
Assignees

Comments

@wangxuepeng
Copy link

wangxuepeng commented Aug 22, 2016

1.0.13 ImportError: No module named 'myapp.apps.MyappsConfig'; 'myapps.apps' is not a package

That's due to django's upgrade from using INSTALLED_APPS to apps.get_app_configs().

Change autodiscover() in tasks.py to below would fix this:

def autodiscover():
'''autodiscover tasks.py files in much the same way as admin app'''
import imp
#from django.conf import settings
from django.apps import apps

#for app in settings.INSTALLED_APPS:
for app_config in apps.get_app_configs():

@jvamvas
Copy link

jvamvas commented Aug 24, 2016

The autodiscover method seems to be legacy code from the original project, and I am not sure whether it contributes anything meaningful.

From version 1.0.14, the ImportError is caught and ignored (which implies that apps that are installed via AppConfig path are not "autodiscovered" anymore).

@all-iver
Copy link

all-iver commented Dec 9, 2017

I don't understand this...my app was configured with an apps.Config file in INSTALLED_APPS and so process_task silently failed until I finally just looked at the source for autodiscover(). Shouldn't this be in the docs somewhere? If tasks are in the db but can't be imported, shouldn't there be some kind of logging error or visible failure somewhere?

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

No branches or pull requests

3 participants