use django developing web site in aws ec2


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

asked 6 months ago50 views
1 Answer


I understand that you're trying to bind django on the Elastic IP addr 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 with the local IP will fix the issue. ( ie : --host )

For ref :

answered 6 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions