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 withlocalhost:8000/my_siteand127.0.0.1:8000/my_site, but notmy_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_siteshould work,127.0.0.1:8000/my_siteshould not work, andmy_ip_address:8000/my_siteshould work. As expected,localhost:8000/my_siteworks and127.0.0.1:8000/my_sitedoes 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.