0
I make a draft django website with django-admin startproject mysite
I go into the directory and run the server python manage.py runserver
I check localhost:8000
with my browser and it shows the default welcome page (which means it works). The server logs:
Django version 2.1.5, using settings 'course.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[29/Jan/2019 08:16:54] "GET / HTTP/1.1" 200 16348
[29/Jan/2019 08:16:54] "GET /static/admin/css/fonts.css HTTP/1.1" 200 423
[29/Jan/2019 08:16:54] "GET /static/admin/fonts/Roboto-Bold-webfont.woff HTTP/1.1" 200 82564
[29/Jan/2019 08:16:54] "GET /static/admin/fonts/Roboto-Regular-webfont.woff HTTP/1.1" 200 80304
Not Found: /favicon.ico
[29/Jan/2019 08:16:54] "GET /favicon.ico HTTP/1.1" 404 1972
[29/Jan/2019 08:16:55] "GET /static/admin/fonts/Roboto-Light-webfont.woff HTTP/1.1" 200 81348
However, when I try to curl it with curl -v localhost:8000
it hangs forever:
* Rebuilt URL to: localhost:8000/
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8000 (#0)
> GET / HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.58.0
> Accept: */*
>
Here is the only line that the server logs:
[29/Jan/2019 08:27:53] "GET / HTTP/1.1" 200 16348
On local machine I can check mysite manually but without curl I do not know how to test my site on server. Anyone knows why?
I have tried many suggestion, curl with -4 option, change the port to 8080 for example, change server to 0.0.0.0, use gunicorn to serve.. the problem persists.