Forums

500 internal server error

i am using this very simple code but i am facing error i have tried many codes but when i link html file no one is working. here is the flask_app.py

from flask import Flask, render_template

app = Flask(__name__)
@app.route('/')
def hello_world():    
    return render_template("/home/cvmror/mysite/templates/headline.html",headline =  "hello world its cvm turan pundri")

if __name__ == "__main__":
    app.run(debug=True)

here is the heading.html

<!DOCTYPE html>
<html>
<head>
<title> my website </title>
</head>
<body>
<h1>  {{ heading }} </h1>
</body>
</html>

i have tried everything but same issue

[edit by admin: formatting]

To debug internal server errors, you should look at the website's error log. There's a link to it on the "Web" page, and the most recent error message will be at the bottom of the file.

Same error here iam getting NameError: name 'render_template' is not defined, but my code is fine

How are you importing render_template?