how to set default ip as 0.0.0.0 for a django project to debug in visual studio 2015?
After so many struggle I found one solution, want to share it with you. Hope you will like it.
open <your python location>\Lib\site-packages\django\core\management\commands\runserver.py and find one code where it deal with self.addr.
if not self.addr:
    self.addr = '::1' if self.use_ipv6 else '127.0.0.1'
It sets default address to 127.0.0.1 change it to '0.0.0.0'. Now, if you run your server with only command ./manage.py runserver It will run on 0.0.0.0, even from visual studio.
Good luck.
I am developing a django rest framework application using visual studio 2015, python 2.7, django 1.9. I have enabled CORS. I can access it from other origin when I run it through command prompt as python manage.py runserver 0.0.0.0:8086. But, in visual studio auto debug, it runs on 127.0.0.0. I want to configure visual studio to run the server on specified ip (ie. 0.0.0.0). So, that debugging will be easy.
I have tried with setting default port and address from site-packages\django\core\management\commands\runserver.py.
and also able to set default port in visual studio property of the project. But, unable to set the default ip.
Can any one help me to configure the ip 0.0.0.0 as default not the default one (127.0.0.1) in visual studio.
Thanks in advance.