Search code examples
djangoweb-deploymentazure-virtual-machineserver-configurationipconfig

cannot acces http://server_domain_or_IP:8000


I am using an AzureVM to host my development API server written in django. There, I cloned my codebase and did all the requirements.txt installation. Before executing the manage.py runserver 0.0.0.0:8000 command, I changed the firewall permission rule: sudo ufw allow 8000. The sudo ufw status commads shows the following result:

Status: active

To                         Action      From
--                         ------      ----
Nginx HTTP                 ALLOW       Anywhere                  
8000                       ALLOW       Anywhere                  
OpenSSH                    ALLOW       Anywhere                  
Nginx HTTP (v6)            ALLOW       Anywhere (v6)             
8000 (v6)                  ALLOW       Anywhere (v6)             
OpenSSH (v6)               ALLOW       Anywhere (v6)  

and then I run python3 manage.py runserver 0.0.0.0:8000.

I should be able to see the default django page @ http://SERVER_IP_OR_DOMAIN:8000 But nothing shows. whereas if I hit http://SERVER_IP_OR_DOMAIN, I can see the NGINX landing page.

I am following this blog from digital ocean.

Here is my VM network rules: VM network rules

How can I fix this?


Solution

  • I tried to reproduce the same in my environment and got the results like below:

    enter image description here

    To resolve this issue:

    In your virtual machine make sure to Add inbound port Destination port ranges as 8000 like below:

    enter image description here