import os
from flask import Flask
from flask import Response,send_from_directory, render_template, request, jsonify
if (not os.path.isdir("templates")):
os.mkdir("templates")
with open("templates/mytemplate.html","w") as f:
f.write("<script>\n"
"var x = {{ some_value }};\n"
"</script>\n")
f.close()
app = Flask(__name__)
@app.route("/")
@app.route("/mytemplate.html")
def hello():
return render_template('mytemplate.html',some_value=123)
if __name__ == "__main__":
app.run()