How to run django in EC2

I have deployed the code in EC2 and the project was run in locally at 8000 port.
but while i accessing the project using public port but it’s showing site can’t be reached

please help and thanks for advance

How are you running your code on the server?

Note: At a minimum, you will want to start with reading How to deploy Django | Django documentation | Django

1 Like

Hi Anthony,

You need to edit your security groups by adding an inbount rule with your port. Additionally, depending on your operatic system you need to set properly your firewall.

1 Like

python manage.py makemigrations

python manage.py migrate

python manage.py collectstatic

python manage.py runserver 0.0.0.0:8000

This is an extremely bad idea for a public-facing instance of Django.

See django-admin and manage.py | Django documentation | Django

Quoting directly from the docs:

DO NOT USE THIS SERVER IN A PRODUCTION SETTING.