django - Dotted name in AppConfig -
with django 1.7 added support configuration classes instead of magic string previous versions.
my project has several applications folder named apps added python_path.
after adding simple appconfig derived class i'm running many import errors , want rule out silly mistakes.
suppose structure:
project_root/ my_project/ apps/ my_app/ another_app/ would correct have config?:
# my_app/apps.py class myappconfig(appconfig): name = 'apps.my_app' # my_app/__init__.py default_app_config='apps.my_app.apps.myappconfig' # settings.py installed_apps = ( ... 'apps.myapp.apps.myappconfig' ... ) curently project fails when trying import models (or tasks or other module) issuing:
from apps.my_app.tasks import awesometask importerror: no module named my_app.tasks
i solved similar issue renaming apps folder. somehow conflicting django internals system.
i hope helps someone.
Comments
Post a Comment