I am getting a Server Error(500) when debug is set to false, But the site works fine when debug=True
This is the Heroku log: [EDIT:NEW LOG FILE AFTER MAKING
Try making migrations with:
heroku run python manage.py makemigrations
heroku run python manage.py migrate
I had the same issue, but this solved it.
While turning off Debugging. You need to provide ALLOWED_HOSTS in a list. Please check Django documentation for more..
Debug = False
ALLOWED_HOSTS = ['xyz.com']
You can't use SQLite3 on Heroku. Switch to Postgres.
You need to provide ALLOWED_HOSTS
Debug = False
ALLOWED_HOSTS = [".herokuapp.com"]
And Heroku you should use PostgreSQL
https://github.com/kennethreitz/dj-database-url
Added this in the settings.py
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'console': {
'class': 'logging.StreamHandler',
},
},
'loggers': {
'django': {
'handlers': ['console'],
'level': os.getenv('DJANGO_LOG_LEVEL', 'DEBUG'),
},
},
}
Got the errors in the log Apparently there was a mismatch with the names of the folders in the remote server and my local machine