I have a django project in my pc.
In terminal I've run python3 manage.py runserver <my ipaddress>:8001
When I try to open the link in another pc, it is showing error page which says:
Invalid HTTP_HOST header: '<my ipaddress>:8001'. You may need to add '<my ipaddress>' to ALLOWED_HOSTS.
What should I do?
And moreover is it possible to put some text in place of ipaddress in the url?
For example, I want to host it as myproject/
instead of that complex url.
Instead of passing
<my-ip-address>
to therunserver
command, pass0.0.0.0
.If both the machines are in the same network you can run the application on 0.0.0.0 IP address (refers to all IPv4 addresses on the local machine). Refer this link wiki 0.0.0.0 for more details. So, on application server run this:
Now, from the other machines, access it using http://youripaddresss:8001 , where < youripaddress > is the actual ip address of your machine.
On one condition this will work
steps:
0.0.0.0
and port any like8000
using this commandrun
ifconfig
if you are using linuxipconfig
if windows then you will get your ip address of your serverOpen browser in another computer and enter the ip of server shown in 3rd step with port as
8000