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()
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()
how to return an html file in flask
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def index():
return render_template('index.html') # You have to save the html files
# inside of a 'templates' folder.
app.run(debug=True)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us