I cannot access my Django app on an EC2 instance (host2) in my browser by typing its public DNS name with port number: ec2-public-dns-of-this-instance.compute-1.amazonaws.com:8000
./manage.py runserver 0.0.0.0:8000
ALLOWED_HOSTS
file which has these now: ALLOWED_HOSTS = ['*', '127.0.0.1', 'ec2-public-dns-of-this-instance.compute-1.amazonaws.com', '0.0.0.0', 'localhost']
curl localhost:8000
which returned me 200 and Django default HTML page when I'm ssh'ed into this instance.curl ec2-public-dns-of-this-instance.compute-1.amazonaws.com:8000
which also returned me 200 and Django default HTML page when I'm ssh'ed into this instance. Any ideas how to fix this would be greatly appreciated!
Interestingly, it started working three hours later. I didn't change anything and all things remain the same as I described above. I have no clue why this is the case...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.