First, you need to find your local IP address with this command in cmd:
ipconfig/all
Open settings.py and add your IP address to the ALLOWED_HOSTS list:
ALLOWED_HOSTS = ['192.168.xxx.xxx']
Finally run command in the terminal:
python manage.py runserver 192.168.xxx.xxx:8000
Voila, now you can visit your Django app by accessing this address(192.168.xxx.xxx:8000) from any device in your local network. I’m using this trick for debugging purposes(visiting my local Django apps from mobile phone devices)
This small article is a part of my startup journey, you can read about my progress here
Check how I’m bootstrapping my Python SaaS projects live at Twitter
Leave a Reply