0

I have a Django 2.2.5 server running on a Windows 7 machine. I'd like to access it from my Android phone to make sure that the website being served by the Django server works well on the Android device. However, the website fails to load on the Android device.

I've look around and found some things to try, but nothing has worked. Here'a list of things I've tried, all of which have failed:

  • Debug = False ALLOWED_HOSTS = ['*']
  • Allowing any traffic through port 8000 through firewall
  • Turning firewall off
  • Accessing from raspberry pi

I've also tried some testing on the Windows 7 machine:

  • When ALLOWED_HOSTS = [], I can access the site with localhost:8000/my_site and 127.0.0.1:8000/my_site, but not my_ip_address:8000/my_site. This may be expected behavior, and I am okay with that.

  • When ALLOWED_HOSTS = ['localhost', my_ip_address], if I'm not mistaken, localhost:8000/my_site should work, 127.0.0.1:8000/my_site should not work, and my_ip_address:8000/my_site should work. As expected, localhost:8000/my_site works and 127.0.0.1:8000/my_site does not work. my_ip_address:8000/my_site, however, does not work.

Can anybody explain this to me and help me access my Django server from my Android phone?

I start the server with the command python manage.py runserver.

hutch90
  • 341
  • 3
  • 15

0 Answers0