I had a similar issue. In my case, I had to do as below:
- To run App in Local LAN *
python manage.py runserver 0.0.0.0:8000
http://localhost:8000
http://127.0.0.1:8000
http://192.168.0.99:8000
- To run App with Public IP *
Port 8080 would not work for me and so I had to add Port 8081.
Add port 8081 in Windows Defender (Inbound Rules)
Add port 8081 in the Internet Router's Virtual Servers
python manage.py runserver 0.0.0.0:8081
http://103.122.xxx.xx:8081
settings.py
ALLOWED_HOSTS = ['127.0.0.1', 'localhost', '103.122.xxx.xx', '192.168.0.99']
I am sure that there could be a better method. As of now this works for me in Visual Studio Code.