带django的简单远程服务器

时间:2014-02-13 18:14:54

标签: python django

我正在学习使用Django。 我正在关注他们的第一个教程: https://docs.djangoproject.com/en/1.6/intro/tutorial01/

我正在使用下面的目录结构在AWS服务器上运行所有内容。

我尝试运行他们的代码来为浏览器进行简单的代码部署: python manage.py runserver

 it runs without error,but when i go to http://127.0.0.1:8000/  chrome throws error "Oops!      Google Chrome could not connect to 127.0.0.1:8000"

我知道我误解了删除服务器的结构。如果有人可以告诉我如何使这项工作,我会很感激。

谢谢


(我的目录结构)

/ home / PythonFiles#ls -R 。: mysite的

./ mysite的: manage.py mysite

./ mysite的/ mysite的: init .py init .pyc settings.py settings.pyc urls.py wsgi.py wsgi.pyc

2 个答案:

答案 0 :(得分:1)

您可以在这篇文章中查看答案:Connecting to EC2 Django development Server

确保通过防火墙设置打开端口8000

答案 1 :(得分:1)

您需要AWS服务器的IP地址,然后使用

python manage.py runserver aws.ip.address:8000

确保8000对公众开放。