Flask blueprint static directory does not work?

后端 未结 5 1157
攒了一身酷
攒了一身酷 2020-12-08 09:56

According to the Flask readme, blueprint static files are accessible at blueprintname/static. But for some reason, it doesn\'t work.

My blueprint is lik

5条回答
  •  无人及你
    2020-12-08 10:36

    I include an argument to the static_url_path parameter to ensure that the Blueprint's static path doesn't conflict with the static path of the main app.

    e.g:

    admin = Blueprint('admin', __name__, static_folder='static', static_url_path='/static/admin')
    

提交回复
热议问题