Application failed to respond - Django
semihsezer
HOBBYOP

a year ago

I have a simple django app running with `python manage.py runserver 0.0.0.0:8000". In my network settings,I have the domain mapped to 8000 but I keep getting application error/502.

The logs don't show any errors. Deploy logs say "container event container died", I don't know if that's expected but I don't see a memory spike either (it is well below trial limit of 500MB, it is around 200MB).

I have been trying to debug this for the last hour. Any ideas what I could be doing wrong?

Solved

1 Replies

semihsezer
HOBBYOP

a year ago

The issue was due to my start command, in which I also wanted to run the migrations before app startup.

ie. it was "python manage.py migrate && python manage.py runserver 0.0.0.0:8000".

I just found out in the docs that to run multiple commands I need to wrap it in quotes. This wasn't very straightforward as I expected this would be equivalent to overwriting the docker compose command field.

Entering it like this works:
/bin/sh -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"


Status changed to Solved brody about 1 year ago


Loading...