2012-02-17 35 views
8

我有一个EC2实例想运行它的Django应用程序。这个EC2实例在端口80上已经有一个Apache服务器。现在我想在端口9090上托管我的Django项目。该实例的静态IP为200.200.200.200。EC2主机与IP地址的Django不能分配 - 错误

[email protected]:~/flanders$ python manage.py runserver 200.200.200.200:9090 Validating models...

0 errors found Django version 1.3.1, using settings 'flanders.settings' Development server is running at http://200.200.200.200:9090/ Quit the server with CONTROL-C. Error: That IP address can't be assigned-to. [email protected]:~/flanders$

它告诉我Error: That IP address can't be assigned-to,所以我改变

[email protected]:~/flanders$ python manage.py runserver 127.0.0.1:9090 Validating models...

0 errors found Django version 1.3.1, using settings 'flanders.settings' Development server is running at http://127.0.0.1:9090/ Quit the server with CONTROL-C.

应用程序启动的时候没有问题,但是当我试图访问它http://200.200.200.200:9090/flandersapp/tags,我不工作。顺便说一句,我在我的安全设置中允许端口9090。

+1

使用弹性IP – Chipmunk 2013-03-08 11:32:24

回答

12

我解决了我自己。我需要使用由EC2代替公共IP提供的私有IP

+0

当我给它的私有IP地址它运行,但当我在公共IP:在浏览器中它不起作用。你能告诉我如何从浏览器运行公共IP:? – 2017-09-05 15:23:47

+0

'0.0.0.0:9090'应该也适用。 – Jheasly 2017-09-27 22:28:10