2021-06-30

Start Django development server on AWS EC2 Amazon Linux

This tutorial here shows how to start the development server on AWS EC2:

ALLOWED_HOSTS=['EC2_DNS_NAME']

...

python manage.py runserver 0.0.0.0:8000
In a browser, navigate to public DNS of the instance, make sure to append port “8000” at the end and if everything was properly configured, it will show the index page of the application.
For example: www.ec2dnsname.com:8000

My public IPv4 DNS is of this form:

ec2-xx-xxx-xx-xxx.region.compute.amazonaws.com

So, in my settings.py

ALLOWED_HOSTS=['ec2-xx-xxx-xx-xxx.region.compute.amazonaws.com']

And run this in the EC2 terminal:

python manage.py runserver 0.0.0.0:8000

However, when I try to reach this address:

www.ec2-xx-xxx-xx-xxx.region.compute.amazonaws.com:8000

nothing is showing up (The page took too long to respond).

Is this the complete and correct way to just try run a development server on AWS EC2?



from Recent Questions - Stack Overflow https://ift.tt/3qBsLos
https://ift.tt/eA8V8J

No comments:

Post a Comment