Answers for "how to use an html file that is in a different directory python flask"

2

flask make static directory

from flask import Flask, send_from_directory

app = Flask(__name__)

@app.route("/static/<path:path>")
def static_dir(path):
    return send_from_directory("static", path)

if __name__ == "__main__":
    app.run()
Posted by: Guest on May-27-2020

Code answers related to "how to use an html file that is in a different directory python flask"

Python Answers by Framework

Browse Popular Code Answers by Language