Django site cant be reached

Question:

I run the server in c9 (django workspace). There were no errors and it said

Starting development server at http://127.0.0.1:8000//.

However, when i open this site it says

This site can’t be reached
127.0.0.1 refused to connect.

Can anyone help me fix this issue

Asked By: Chaitanya Krishna

||

Answers:

In the documentation says that you use a URL they give to you (not localhost) to access the server

Use the Share button on the top to figure out the URLs of running Application and the Preview.

See https://docs.c9.io/docs/run-an-application#section–pre-view-your-application

Answered By: jperelli

127.0.0.1 is your local computer, not the c9 instance. The docs refer to a unique URL for each app, like: http://<workspacename>-<username>.c9users.io:8081

So, try using runserver like this: python manage.py runserver $IP:$PORT

You can then look in your browser tab for the server address that you can see your app running on, which will be similar to the one above. You’ll use that when testing instead of localhost or 127.0.0.1.

Check out the Django guide on their site for more details.

Answered By: Cody Parker

If you are using a proxy server, you can check the "do not use proxy for local addresses" button in the proxy settings. for me this worked.

Answered By: user21453299
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.