Can't connect heroku local to 0.0.0.0:5000

385 Views Asked by At

I'm trying to deploy my first Django app on Heroku. The django app works fine with Heroku Local on Localhost:5000, but does not work on 0.0.0.0:5000. It also crashes on Heroku.

Requirements.txt


asgiref==3.5.1

dj-database-url==0.5.0

Django==3.2.5

django-heroku==0.3.1
psycopg2==2.9.3
pytz==2022.1
sqlparse==0.4.2
whitenoise==6.0.0



Procfile



web: python manage.py runserver 0.0.0.0:5000
1

There are 1 best solutions below

0
On

Make sure you have 0.0.0.0 in your settings.py file like so:

ALLOWED_HOSTS = ['0.0.0.0', 'localhost', 'exampledomain.com']