#Whenever we receive 500 internal server error on a Python wsgi application we can log it using 'logging'
#1. First import:
from logging import FileHandler,WARNING
#2. after following code:
app = Flask(__name__, template_folder = 'template')
#3. add logging file:
file_handler = FileHandler('errorlog.txt')
file_handler.setLevel(WARNING)
#4. Now you can open errrorlog and debug your app