[Answered ]-Django heroku app successfully deployed but still showing an internal server error, Log files show the build is successful

1πŸ‘

I finally figured out the issue, I had connected my heroku app to a github repository where one of my apps folder was missing some folder and files; so if by any chance you run into any problem of this kind in the future and your build is successful please try to check if you have any missing files and also remember to check your server logs, thankyou so much -Chris for suggesting that I check my logs. Happy Coding πŸ™‚

πŸ‘€BJ_GOST

0πŸ‘

In your urls.py file you have mentioned media root path but actually it’s not defined in your settings.py file.

You can define it as shown below.

Base url to serve media files
MEDIA_URL = '/media/'
# Path where media is stored
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
πŸ‘€Ajay K

0πŸ‘

I had this same issue after modifying my models.py and deleting previous migration files (not advisable). My database worked well locally but showed Internal Server Error (500) after deployment to Heroku.

I fixed it by simply removing the Heroku Postgres addon and attaching it back. This is because I added a new field to my models, it reflected locally but wasn’t provisioned on the Heroku Server. Note that you may lose your existing data if you use this approach.

For managing addons (attaching/removing) on Heroku, see here https://devcenter.heroku.com/articles/managing-add-ons

πŸ‘€journpy

Leave a comment