Properly Run Python Django under a local network

Properly Run Python Django under a local network

by

in

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


Comments

One response to “Properly Run Python Django under a local network”

  1. […] These tips I have applied to my ddnames.com microservice project. If you’re testing your project locally, you might be interested in this post on how I’ve been running Django under a local machine. […]

Leave a Reply

Your email address will not be published. Required fields are marked *