This is my Python code:
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/profile/<name>")
def profile(name):
return render_template("index.html", name=name)
if __name__ == "__main__":
app.run()
and HTML code:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
Hello {{ name }}
</body>
</html>
And when I run the Python code, it shows on the browser that:
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
I looked for the solution on Google as well as Youtube, but still can't fix it. Can someone help me with this? Thank you
Edit: so all I need to do is to fix this one line:
app = Flask(__name__, template_folder="template")