Answer the question
In order to leave comments, you need to log in
How to set domain name in Django project?
In settings.py, the ALLOWED_HOSTS setting is set as follows:
When I run "python3 manage.py runserver 0.0.0.0:8000" in the terminal, I can only go to 10.0.0.3:8000, if I enter a domain name, the browser reports that server not found. What I mean is that I can't specify a domain name in the Gunicorn config - if I specify an ip address I get into my application without any problems, but if I specify a domain name and enter it in the browser query string, then there will also be a message about that the server was not found. I can’t figure out how to correctly set the domain name so that I can enter it to go to the application?
Answer the question
In order to leave comments, you need to log in
Write in your computer /etc/hosts 10.0.0.3 domain_name and add domain_name to ALLOWED_HOSTS. After that, the IP address for domain_name will be found and you will be able to open your site.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question