5👍
✅
For development, you can try setting this in settings.py
:
ALLOWED_HOSTS = ['*']
and then start your server locally by running:
python manage.py runserver 0.0.0.0:8000
0👍
To answer your question of
What could have been possibly wrong?
A number of things:
- The mapping of your parts is incorrect. Your application is mapping to another port other than 8000. Check which port your application is mapped to. Not by checking the output of
python manage.py runserver
, because that is not the command you run in your container. Check the logs of your container. - When your command
gosu app bash
is run, there is an error. Check the output ofdocker logs backend
. - You could be running the
docker-compose up -d
command incorrectly.
Post the out put of the logs if you want more information.
- [Django]-Django model joining a one to many relationship for displaying in a template
- [Django]-Upgrade Django project to Python3 – migrations fail
- [Django]-ModuleNotFoundError: No module named 'django.templates'
- [Django]-How to use value from URL and request in Django DetailView?
Source:stackexchange.com