4π
β
I was running my application using the command:
docker-compose run app python3 manage.py runserver 0.0.0.0:8000
With docker-compose you need to use the argument --service-ports
to:
Run command with the serviceβs ports enabled and mapped to the host.
Thus my final command looked like this:
docker-compose run --service-ports app python3 manage.py runserver 0.0.0.0:8000
Documentation on run
can be found here
π€Preston
2π
If you are running docker inside a virtual machine then you need to access your application through the virtual machine IP address and not using localhost or 127.0.0.1. Try to get the virtual machine IP. Also please specify in which platform/environment you installed and running the docker.
π€Coder
- [Django]-Django-REST or Firebase?
- [Django]-How to get module variable in function from another module?
- [Django]-MySQL Query error when run within Python but not when run directly
- [Django]-How to configure django to generate signed urls for media files with Google Cloud CDN?
Source:stackexchange.com