11

There are 11 best solutions below

1
On

Check the logs of your Heroku application to see more details. You can stream the log using the Heroku CLI after logging in:

heroku logs -t

Alternatively, you can view the logs on the app dashboard.

1
On

I fixed my issue by removing .env file from my gitignore.

0
On

I was facing the same issue with this. Locally the app works but when I pushed it to heroku I was getting an internal server error. Then I realized that the path was rather not known.

assume this is the url for the app on heroku, https://myapp.herokuapp.com

this url was the error, because the route did not exit not looked like any of the routes I had. My route start with or my base url was, myapp/

https://myapp.herokuapp.com/myapp/ worked for me.

I was running http://127.0.0.1:5000/myapp/ locally which should be the same as https://myapp.herokuapp.com/myapp/ on heroku

2
On

Do you use database ? if yes, don't forget to add database add-ons in resource of your heroku project and create table that you need in database.

0
On

I was stuck with the same problem. For me the problem was in my_project/wsgi.py . I had setup 3 settings file under my_project/my_project/settings folder and I had configured the necessary configuration under manage.py to detect the setting file but forgot the configuration under my_project/wsgi.py . So resolving this solved the problem for me.

0
On

Add the APP_KEY from the terminal as:

heroku config:set APP_KEY=[App_key] -a project-name 

this worked for me.

0
On

Check response redirect in your control and in file name view (html) , uppercase and lowercase characters very influential

0
On

I removed the .env file from my .gitignore file while pushing my code to Heroku. It is worked for me.

0
On

If your application has a database (as it should) make sure to makemigrations and perform migrate. You can do this using Heroku CLI from your Heroku App dashboard.

To make migrations ==> python manage.py makemigrations

To migrate ==> python manage.py migrate

If the above suggestions do not fix the (500) problem, go to your environment variable and change its value to True. Then return to your application to read the error message. Your cue will definitely be there.

Cheers!

0
On

I know I'm late, but in my case it was also just adding the KEY that I was loading locally from .env to the heroku server as an environment variable.

You can simply do it like this:

heroku config:set SECRET_KEY_NAME="YOUR_SECRET_KEY_VALUE"

For example, it could be something like this:

heroku config:set API_KEY="probablysomestringofcharacters"
1
On

Apparently, I was being displayed the same error but after 3-4 minutes, the web application finally got loaded on heroku. Most probably it's caused due to setting up of webpage on the heroku's server.