3

I have a t1.micro instance with the public DNS that looks similar to the following:

ec2-184-72-67-202.compute-1.amazonaws.com

(some numbers have been changed)

On this instance, I am running the following Django app:

$ sudo python manage.py runserver --settings=vlists.settings.dev
Validating models...

0 errors found
Django version 1.4.1, using settings 'vlists.settings.dev'
Development server is running at http://127.0.0.1:8000/

I have opened the port 8000 through the AWS console

Screenshot:

When I navigate to the the following URL in Chrome, I get the message: Oops! Google Chrome could not connect to:

http://ec2-184-72-67-202.compute-1.amazonaws.com:8000

What am I doing wrong?

Netstat:

netstat -lan | grep 8000
tcp        0      0 127.0.0.1:8000          0.0.0.0:*               LISTEN 
slayernoah
  • 1,650
  • 2
  • 13
  • 19
learner
  • 163
  • 2
  • 9

2 Answers2

5
>Development server is running at http://127.0.0.1:8000/

Sounds like the server is set to respond only on the localhost.
Check your Django config, and make sure it's set to respond on all interfaces.

Update:

netstat -lan | grep 8000
tcp        0      0 127.0.0.1:8000          0.0.0.0:*               LISTEN 

Yep, definitely an issue with your bindings. 127.0.0.1 should instead be your Public IP or 0.0.0.0 for all interfaces.

bbezaire
  • 175
  • 6
3

You need to bind the runserver to all ports.. by default it just binds to localhost

 python manage.py runserver --settings=vlists.settings.dev 0.0.0.0:8000
Mike
  • 22,310
  • 7
  • 56
  • 79