Django console not working properly on docker
Hello! I'm working on a django project to try docker, so I've made the docker file, the docker compose, and all that stuff. The project runs fine, I can develop fine, but the problem raises when I want to use the console.
Aparently it starts ok but when I try to import stuff from my models, I'm getting this error:
django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
I've noticed the command used to start the console:
/usr/local/bin/docker-compose -f /home/santiago/PycharmProjects/dockertodo/docker-compose.yml -f /home/santiago/.PyCharm2018.3/system/tmp/docker-compose.override.331.yml run --rm -p 0.0.0.0:40103:40103 web
Shoudn't be this comand somthing like:
/usr/local/bin/docker-compose -f /home/santiago/PycharmProjects/dockertodo/docker-compose.yml -f /home/santiago/.PyCharm2018.3/system/tmp/docker-compose.override.331.yml run --rm -p 0.0.0.0:40103:40103 web python manage.py shell
?
But I can't find a way to set it up. Please, can you help me?
Thank you!!
请先登录再写评论。
Well I've found out the problem. I'm not sure why, but the console settings were different to the settings of another project where the console works well. I've copied the starting script and now it works fine.
Cheers!
@Santiagovassallo 's solution worked for me. Thanks mate!!