Server 500 Error - Django Deployment

Hey All,

I just deployed my app, able to punch it through successfully after some debugging but it’s returning a 500 server error, not sure how to troubleshoot from here.

https://datatibute-fly.fly.dev/

I would start by checking out your logs. You can view them in the dashboard or using the fly logs command. Once you go to the logs page on the dashboard or run that logs command you may have to reproduce a 500 error again to see the logs you care about.

https://fly.io/docs/getting-started/working-with-fly-apps/#viewing-logs

thanks for the suggestion. I have however looked in the logs and nothing insight is there. It does not have any records a part from the last successful deployment.

Hey, I’m having the exact same problem.
Built with Django, the site works perfectly in development mode. I have deployed it successfully to fly and have made many version updates, each with sucessful deploys… But it still shows Server 500

Did you eventually find a solution?

I suspect the issue is not “migrating” your production database. Try running fly ssh console -C "python /code/manage.py migrate" and see if that fixes it.

1 Like

You might also need the --pty flag for createsuperuser etc. Superuser creation skipped due to not running in a TTY

Yeah I am also getting no logs at all around a 500 errors.

I can hit my admin page just fine, but trying to go to the “” path on my Django app just gives a 500, and there’s literally nothing in the logs since my deploy

All my migrations have been made and applied and I’ve got a superuser (can log in to admin)

did you ever find a solution. I deployed an app with photos and I get error 500 with I click to see the photos

Same problem, I don’t see any logs, any idea how to move forward, Internal Server Error and logs shows nothing.

@rypptc A 500 error in a Django app is a very broad problem. The chances are that your issue has a different cause to the earlier ones in this post.

I’d suggest posting a new thread, with as much information as you can muster. A Fly employee might see your post and work out what account/app is yours, and thus would be able to dig into the backend, but your fellow customers will have no chance diagnosing the problem with such a limited amount of detail.

Even if your Fly app isn’t seeing any logs, your Django app will still be making them internally. So I’d suggest shelling into your machine and gathering logs from wherever Django stores them. Also, check that your listener is still running, using the appropriate Linux tools. Finally, your web framework may offer console tools, e.g. to look at the status of your migrations; these may help to obtain a general healthcheck of your app.

Thank you for your response. I’ve already solved the issue — I installed Sentry to get detailed error reports, which helped me identify and fix the problem.