Answer the question
In order to leave comments, you need to log in
How to access Django application from Docker?
I am taking my first steps in mastering Docker.
For the sake of experiment, I launched a container based on the ubuntu image
docker run -it -d -p 8000:8000 --name django ubuntu
python3 django-admin startproject site
python3 manage.py runserver
Unable to connect to site.
The page at 127.0.0.1:8000 may be temporarily unavailable or moved to a new address.
Answer the question
In order to leave comments, you need to log in
at least - this is how you need to run it:
python3 manage.py runserver 0.0.0.0:8000
otherwise, django listens to the localhost inside its container
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question