连接到EC2 Django开发服务器 [英] Connecting to EC2 Django development Server

查看:176
本文介绍了连接到EC2 Django开发服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的EC2和web开发。目前,我有一个Linux EC2实例中运行,并且已经安装的Django。我创建一个测试项目开始之前,我对我的真正的项目,并试图运行Django的测试服务器。

I am new to EC2 and web development. Currently I have a Linux EC2 instance running, and have installed Django. I am creating a test project before I start on my real project and tried running a Django test server.

这是我在shell输出:

This is my output in the shell:

python manage.py runserver ec2-###-##-##-##.compute-1.amazonaws.com:8000
Validating models...

0 errors found
Django version 1.3, using settings 'testsite.settings'
Development server is running at http://ec2-###-##-##-##.compute-1.amazonaws.com:8000/
Quit the server with CONTROL-C.

要测试它wroking我已经试过访问: EC2 - ### - ## - ## - ## compute-1.amazonaws.com:8000但我总是得到一个无法连接的消息,从我的浏览器。

To test that it is wroking I have tried visiting: ec2-###-##-##-##.compute-1.amazonaws.com:8000 but I always get a "Cannot connect" message from my browser.

每当我这样做lcoally我的电脑上,但是我也成功地得到Django开发主页,网址为127.0.0.1:8000。可能有人帮我找出我在做什么错误/可能会丢失,当我在我的EC2实例这样做,而不是我自己的笔记本电脑?

Whenever I do this lcoally on my computer however I do successfully get to the DJango development home page at 127.0.0.1:8000. Could someone help me figure out what I am doing wrong / might be missing when I am doing this on my EC2 instance as opposed to my own laptop?

推荐答案

您可能没有8000端口在防火墙上打开。检查其安全组的实例运行(可能是默认),检查正在运行的规则。你可能会发现8000端口没有被列出。

You probably don't have port 8000 open on the firewall. Check which security group your instance is running (probably "default") and check the rules it is running. You will probably find that port 8000 is not listed.

这篇关于连接到EC2 Django开发服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆