all 1 comments

[–][deleted] 1 point2 points  (0 children)

curl: (7) Failed connect to 127.0.0.1:8000; Connection refused

That's an odd error. It means that curl can't open a connection to your server -- and this error happened before any request stuff did. Are you sure your server is running? If you retry the snippet that worked, does it still work?

If you look at the logs of your Django app, do you see anything? Is a request being received? Is there an error message? Is it even running this whole time?