Django manage.py runserver never finishes “validat

2019-06-08 21:00发布

问题:

I am trying to follow the django tutorial. I am running on windows+eclipse. When I run python manage.py runserver I get the message Validating models... and afterwards see no progress...

Am I doing something wrong?

回答1:

I've got my answer in another question: can't get django to work in eclipse + windows

When I ran the server with the --noreload option, I saw that there's an exception thrown. After I fixed that, the output does complete, and says:

Validating models...
0 errors found

Django version 1.2.1, using settings 'XXX'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.


回答2:

The shell is running the runserver process, and it won't go back to a command prompt until the server process ends. So, this sounds normal.

Is the server functioning?



回答3:

You could possibly be importing something in your models.py file that is failing in another file. I had an import in a try/catch clause that caused this behavior. Installing the missing dependency fixed the problem.



回答4:

This is what you're supposed to see. If you make a request to your test site (via your browser), you will see the log of the request. If you don't see that, then something else is wrong.