500 internal server error

Hello i am new to flask and python app, i have created flask app which fetch data from mysql and display some pages like profile page which does not fetch or do operation with database are running fine and well but the pages who display data from database are showing error like 500 internal server error please help me its quite important for me

Have a look at your server and error logs for tracebacks that you can use to start debugging.