I need to expose some icons from a folder in flask like so:
PROJECT NAME
>> static
>> assets
>> icon-16.png
>> icon-32.png
>> icon-64.png
>> icon-80.png
>> icon-120.png
>> logo-filled.png
>> templates
>> commands.html
>> index.html
>> taskpane.html
>> app.py
I need to make the assets
routeable so I can access the png files from urls like this:
https://pythonlinuxtest.azurewebsites.net/assets/icon-16.png
https://pythonlinuxtest.azurewebsites.net/assets/icon-32.png
https://pythonlinuxtest.azurewebsites.net/assets/icon-64.png
Here is what I have in my app.py
so far:
from flask import Flask
from flask import render_template
app = Flask(__name__)
# @app.route("/")
# def hello():
# return "Hello, World!"
@app.route("/")
def index():
return render_template("index.html")
@app.route("/taskpane.html")
def taskpane():
return render_template("taskpane.html")
@app.route("/commands.html")
def commands():
return render_template("commands.html")
I am not sure how to add the assets
directory to the app.py so the png files are accessible.