Search code examples
djangofile-transferlan

How can I troubleshoot PCs not seeing each other over my LAN


  1. I'm a complete newbie when it comes to networking. I have two PCs on my LAN both running Manjaro. My main aim is to test functionality on a Django server running on one PC, from the other. I am running the Django server on the PC with ip address 192.168.1.138 using the command

    python manage.py runserver 192.168.1.138:8000

and in settings.py

ALLOWED_HOSTS = ['localhost',  '192.168.1.138']

I can ping 192.168.1.138 from the client PC, and ping the client PC from the server PC. But if I enter the ip address/port into the browser, it fails with

took too long to respond

  1. I don't know if this a separate problem or a manifestation of the first, but when I run NitroShare, I am able to 'see' the PC running the Django server from the PC acting as the client, but if I try to transfer a file, again it times out. I am unable to see the client from the server in NitroShare.

Any suggestions or help gratefully received


Solution

    1. Ensure you don't have a firewall running (or that it allows connections to port 8000). Manjaro's docs imply there might be no firewall by default, but in case there is, see https://wiki.manjaro.org/index.php?title=Firewalls
    2. Set ALLOWED_HOSTS = ['*'], don't bother with limiting them.
    3. Run with python manage.py runserver 0:8000 ; the 0 stands for 0.0.0.0, i.e. has the server listening on all network interfaces.