[Django]-Access Django App on AWS ec2 host

12👍

You need to open HTTP port in AWS instance menu.(all ports except ssh closed in AWS)
Go to your console.aws.amazon.com, then pick your instance and go to last menu item “security groups”. It lauch wizard, click on “Inbound” in bottom menu, then “edit”, and add HTTP or any port what you want 🙂
And be sure you using your public AWS IP, to open in browser

Add some screen for you, hope it help:
enter image description here

enter image description here

enter image description here

5👍

In order to archive this all you need to do 3 simple steps.

  1. Go to the EC2 Console and open up the security group of your instance. go to inbound tab.
    click Edit and then press add rule…add entry with type of Custom TCP Rule and port 8000..
  2. Go to your Django project,your app and open up the settings.py script. List your IPv4 address in the allowed_hosts section.. Ex : ALLOWED_HOSTS=[‘public IPv4′]’
  3. Now in the console run command python manage.py runserver 0.0.0.0:8000…

Open any web browser(from any device) and open the link ‘public IPv4’:8000

No need any app servers like Apache, NginX..

0👍

@Baterson is right. You should open port 8000 for your server first.

Official document is here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/authorizing-access-to-an-instance.html . It is highly detailed.

Leave a comment