broadcast django runserver Mar
22
1
0

Sometimes I need to broadcast a django project through the local network, or even externally, with runserver. This is pretty easy to do, although it should only be only be done for development. Never use runserver for production.

Running it through the local network will allow you to connect to your computer from any other computer on the local network. This is handy for client presentations or IE debugging.

You must first find your inet address. You can do this easily with the <ifconfig> command. After that just initialize runserver by passing it the ip and port (remember to source your virtualenv if needed).

ifconfig

./manage.py runserver 192.168.1.2:8000

If for some reason you need to broadcast runserver externally you can bind it to your external ip, or let automatically detect it like this:

./manage.py runserver 0.0.0.0:8000
Bookmark and Share
blog comments powered by Disqus