This Problem can occur because of following reasons:
(Less Probable) You computation code is too Slow: Which is a rarity because the Timeout is set to about 1 minute or so, and code doesn't take that time to Execute
Your app is waiting on some external resource but it is not Responding. For this you will have to check for the Django logs and check if some external resource error is there
(Most Probable) Database taking too much time: This can occur either because:
- App can't connect to Database: For this you have to check database logs OR try and connect manually with database through
python manage.py dbshell
- DB Query Taking so much time to execute: You can test this by checking database logs for how much time a query is taking OR you can connect manually via dbshell and make the same query there
- App can't connect to Database: For this you have to check database logs OR try and connect manually with database through
Your can also use tools Like django-profiler , Django debug toolbar etc for debugging purposes. and for native python code python debugger