Click here to Skip to main content
15,944,401 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
im getting this error in flask - ERROR in app: Exception on / [GET]

What I have tried:

from flask import Flask, render_template
app = Flask(__name__)

posts = [
    'author': 'Corey Schafer', 
     'title': 'Blog Post 1',
     'content': 'First post content',
     'date_posted': 'April 20, 2018'
   } ,
     'author':'Jane Doe',
     'title':'Blog Post 2',
     'content':'Second post content',
     'date_posted':'April 21,2018'

def home():
    return render_template('home.html', posts=posts)
def about():
     return render_template('about.html')
if __name__=="__main__":   
<pre lang="Python">
Updated 24-Aug-22 6:20am
Richard Deeming 24-Aug-22 12:02pm    
You'll need to get the actual exception details to have any hope of solving the problem. At the moment, all you've got is a generic "something went wrong" error, which tells you nothing.

Use the Flask debugger to debug your code so you can get the actual exception details.
Aalam Pratap Bedi 25-Aug-22 2:17am    
Hey, 1st of all thanks for trying to help me to find a solution. I have tried to check errors in python code and the code seems to be without any errors. I am not sure what to do next. Kindly help.if required, i can provide you my html file code as well.
Richard Deeming 25-Aug-22 3:44am    
If the code was without errors, then you wouldn't be getting the "ERROR in app: Exception on / [GET]" message.

As I said, you need to get the actual details of the exception to stand any chance of solving it.
Aalam Pratap Bedi 25-Aug-22 7:44am    
I'll try to find the details of the error.Thanks once again.
Aalam Pratap Bedi 26-Aug-22 0:55am    
I think im able to find the actuall error. Kindly help me to solve this error. im posting a new question in which i will provide the code of my html file as well

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900