Good day everyone. There is an Eltex router where I configured port forwarding from 80 to 8000 (default port for django) to the computer I need (there are two of them: the main one has the address 192.168.1.5), which has the address 192.168.1.10 in the internal network. The goal is to open up public access to jango from the outside. When I start the django server, it appears in netstat

tcp 0 0 localhost:8000 *:* LISTEN 

From the main computer I try to open jango - 192.168.1.10:8000, but I get connection refused. In iptables prescribed the opening of ports, but it is useless. If I run django on port 80, then I can get it on a LAN (192.168.1.10), but I cannot do it from the outside (What am I doing wrong? Thanks.

    1 answer 1

    192.168.1.10:8000 you are trying to open this address and django listens to localhost:8000 ie 127.0.0.1.
    Try to start the server on a public ip and not on a local loop ie.

     ./manage.py runserver 192.168.1.10:8000 

    or on the address 0.0.0.0

     ./manage.py runserver 0.0.0.0:8000 
    • Thank you very much! :) ./manage.py runserver 192.168.1.10:8000 - helped - keywoker