use django developing web site in aws ec2

0

When I try to start the Django web server using the command "uvicorn DLAEv1.asgi: application --host 52.4.xxx.52 --port 8004", I always get error "error while attempting to bind on address ('52.4.xxx.52', 8004)": cannot assign requested address

질문됨 2년 전323회 조회
1개 답변
0

Hi,

I understand that you're trying to bind django on the Elastic IP addr 52.4.xxx.52 on an EC2 instance.

Elastic IP addr are not directly binded on an EC2 instance, they are associated with an ENI of your EC2 instance which usually has a private IP from the VPC. That's why Django is unable to find this IP addr to bind on.

If you have only one interface mounted on your EC2 instance you can find out with this command on linux " ip addr " and "ipconfig" on windows.

finally, replacing your --host 52.4.xxx.52 with the local IP will fix the issue. ( ie : --host 172.31.xxx.xxx )

For ref : https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html

AWS
Julien
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠