14

I have been using django for quite some time now and I had no problems in using it, until now.

When I run in the terminal py manage.py runserver 127.0.0.1:8000 it shows

Performing system checks...

System check identified no issues (0 silenced). July 23, 2015 - 16:17:23 Django version 1.8.3, using settings 'projectname.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. Performing system checks...

And then when I opened it in my browser, it does not show me anything. It just load and load and load..

I tried googling it but some suggested that I change my port, so I changed it, some said to use my ipaddress with a port other than 8000, and I did but nothing was of help to me. It's stuck on loading the page.

I am using django 1.8.3. Running it on Windows btw

predator
  • 477
  • 2
  • 6
  • 22

6 Answers6

4

Give it a try with binding to all of the network interfaces:

python manage.py runserver [::]:8000

You should be able to see what port it is listening on. Go to START, and type cmd. Right click cmd and Run As Administrator. Then type:

netstat

Do you see anything in that list like?

TCP    0.0.0.0:8000          YourPC-PC:0          LISTENING

That would be the listing of the Django runserver in your network ports list.

FlipperPA
  • 13,607
  • 4
  • 39
  • 71
3

Try restarting your computer.

Same thing happened to me on my Windows 10 machine while debugging multiple APIs running locally on flask dev server and accessing them with my Django webapp. Closing and restarting the Django server didn't help as it showed no errors on the console while the webapp page still won't load. Doing a restart eliminates this problem that may have been caused by multiple servers running and restarting while in the process of debugging.

Note: Make sure to do a restart and not a regular shutdown since fast boot is enabled by default as of Windows 8. Else, it will just load the previous state of your system and the problem will persist.

Wargream
  • 181
  • 6
1

try following the following steps:

first find the process running on port 8000 by command:

netstat -tulpn | grep 8000

take the pid and kill it using command

kill pid

run python server using command

 python manage.py runserver 0.0.0.0:8000
cryptoKTM
  • 2,593
  • 22
  • 21
0

Try this with 0.0.0.0 if you are running in remote server.

python manage.py runserver 0.0.0.0:8000

If not, check whether port is listening.

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

For windows

>netstat -a -b
itzMEonTV
  • 19,851
  • 4
  • 39
  • 49
  • It says that it's listening then it has been established.. but still the page is loading.. – predator Jul 23 '15 at 08:59
  • kill it `netstat -tulpn | grep 8000` and The last line should display something like `1234/python`. Now kill it with `kill 1234`.Or restart system – itzMEonTV Jul 23 '15 at 09:05
  • 1
    Thank you for the answer. I've used `netstat -a -b` and checked the status, it still says established and listening.. I just recreated the project because I have deadlines to meet and cannot afford to be stuck on this. – predator Jul 27 '15 at 00:45
  • Did you checked after restart ? – itzMEonTV Jul 27 '15 at 05:34
  • cd `/anyfolder/` then `python -m SimpleHTTPServer 8000` and then got to `http://localhost:8000/`. or try `python -m http.server 8000` and check – itzMEonTV Jul 27 '15 at 06:23
  • `SimpleHTTPServer` returned a `No module found`. Then I tried `python -m http.server 8000` then go to localhost:8000 and showed me directory listings.. Is that how it's supposed to be? – predator Jul 27 '15 at 06:33
  • are you running inside a virtualenv ? – itzMEonTV Jul 27 '15 at 06:51
0

If it helps with anyone. I came across with this problem also running on Windows, restarting Django didn't seem to help. However, when I looked at Task Manager, there seem to be other old python process running. After I killed those process, and restarted Django, it starts working.

0

I solve this problem by change my current node into management node, instead of compute node. Although I don't know why this works, I know when we runserver in compute node, it won't work.