Django server not responding when opened in browser

I've been using django for quite some time now and so far I have had no problem using it.

When I start the terminal py manage.py runserver 127.0.0.1:8000

it shows

Performing System Checks ...

The system check revealed no problems (0 disabled). July 23, 2015 - 16:17:23 Django version 1.8.3 using the 'projectname.settings' setting Start development server http://127.0.0.1:8000/ Log out of the server using CTRL-BREAK. Performing System Checks ...

And then when I opened it in my browser, it doesn't show me anything. It just download and upload and download.

I tried using it on google but some suggested that I change the port so I changed it, some said to use my ipaddress with a port other than 8000 and I did, but nothing worked for me. It was loaded on page load.

I am using django 1.8.3. Running it on windows btw

+3


source to share


5 answers


Try this with help 0.0.0.0

if you are running on a remote server.

python manage.py runserver 0.0.0.0:8000

      

If not, check if the port is listening.



sudo nmap -sT -O localhost #to install=> sudo apt-get install nmap

      

For windows

>netstat -a -b

      

0


source


Try binding to all network interfaces:

python manage.py runserver [::]:8000

      

You should be able to see which port it is listening on. Go to START and enter cmd

. Right click cmd

and run as administrator. Then enter:

netstat

      



Do you see anything on this list?

TCP    0.0.0.0:8000          YourPC-PC:0          LISTENING

      

This will be a list of Django servers in the list of network ports.

0


source


If it helps anyone. I ran into this problem also working on Windows, restarting Django didn't seem to help. However, when I looked at the task manager, it looks like another old python process is running. After I killed this process and restarted Django, it starts working.

0


source


Try to connect to the internet, it doesn't make sense, but it worked for me. : P

0


source


Try restarting your computer.

The same thing happened to me on my Windows 10 machine while debugging multiple APIs running on a local flask dev server and accessing them using my Django webapp. Closing and restarting the Django server did not help, as there were no errors in the console until the webapp page had loaded yet. Performing a restart fixes this issue, which can be caused by starting and restarting multiple servers during the debugging process.

Note. Be sure to do a reboot and not a normal shutdown, as by default the operating system boots by default with Windows 8. Otherwise, it will simply load the previous state of your system and the problem will persist.

0


source







All Articles