2👍
This is because docker-compose run
runs another container, a new container, that it is trying to attach to the same network as your docker-compose up
container, so that they can work together.
This won’t work with host
networking, due to the publishing rules.
Instead, you could use docker-compose exec web python manage.py periodico
0👍
I know this answer is late for the question, but docker still has the same problem. The problem with @RawKode for me was undefined variables such as DATABASE_URL. You can solve it with
docker run -it --rm --net=host <image_name> <command>
adding -e / --env-file
and variables names.
The command is longer but it works exactly the same as docker-compose run.
- [Answered ]-Request.method == 'POST' is not working in Django
- [Answered ]-How can I put XML in a HTML template? python/Django
- [Answered ]-Django JSONField
- [Answered ]-Testing celery task
Source:stackexchange.com