Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

internal server error 500 python flask

#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
 
PREVIOUS NEXT
Tagged: #internal #server #error #python #flask
ADD COMMENT
Topic
Name
5+4 =