L
L
Lagenodelphis2022-01-04 19:41:24
Flask
Lagenodelphis, 2022-01-04 19:41:24

How to use flask to issue a static file on request WITHOUT using templates?

How to give a simple static file file1.html in response to a request NOT using templates

from flask import Flask, request

app = Flask(__name__)

@app.route('/red')
def index():
    return ???file1.html???
 
if __name__ == '__main__':
    app.run(debug=True)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Shvedov, 2022-01-04
@Lagenodelphis

https://flask.palletsprojects.com/en/latest/api/?h...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question