[Fixed]-How to specify which eth interface Django test server should listen on?



I think the OP is referring to having multiple interfaces configured on the test machine.

You can specify the IP address that Django will bind to as follows:

# python manage.py runserver

This would bind Django to all interfaces on port 8000. You can pass any active IP address in place of, so simply use the IP address of the interface you want to bind to.

Hope this helps.



Yes, if the IP of your interface is for example and you want to run on port 8080, start the development server like this:

./manage.py runserver
πŸ‘€Luper Rouch


No. It’s not how it works. The interface has an IP address, you have a network with the test server and your PC. You should connect to that IP (possibly with an alternative port that you specified), and that’s all. If you only have these two devices in the network, it is most likely that both of them should have static IP addresses. (or, if there is not mutual network, you cannot connect to each other).

Leave a comment