Oct-19-2017, 05:55 PM
Hallowings,
I am following tutorials of https://www.youtube.com/watch?v=OuDOr32ZHE0
I started writing my first python/html document (pip installed, flask too, virtual environment activated, did my first "Hello world" on 127.0.0.1:5000 and next moving to smt. tiny more complicated)
and I am getting error messages. I am not certain what might be the problem, console says smt. about TemplateNotFound: test.html(???)
so here is the code:
python doc (app.py):
Sincerely,
the Noob Noob
I am following tutorials of https://www.youtube.com/watch?v=OuDOr32ZHE0
I started writing my first python/html document (pip installed, flask too, virtual environment activated, did my first "Hello world" on 127.0.0.1:5000 and next moving to smt. tiny more complicated)
and I am getting error messages. I am not certain what might be the problem, console says smt. about TemplateNotFound: test.html(???)
so here is the code:
python doc (app.py):
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def index():
tv_show = "The Office"
return render_template("test.html", show = tv_show)
if __name__ == "__main__":
app.run()and HTML file (test.html):<!DOCTYPE html>
<html lang="en">
<head>
<title>Hallo World</title>
</head>
<body>
<h1>My favorite TV show is {{ show }}</h1>
</body>
</html>if anyone has any idea, thanks for help.Sincerely,
the Noob Noob
