Change Flask static folder name to "assets"

715 Views Asked by At

I am using app "Bootstrap Studio" to build my html,css. it always generating the static folder as "assets".

also am using FLASK, which always search for static folder as "static". and it is kinda hard to keep renaming the assets folder to be "static".. so gently . is it possible to change static folder name to : 'assets' in FLASK. ? to be something like this :

run.py
WebFiles/
    index.html
    assets/
          css/
             styles.css
          js/
             main.js
1

There are 1 best solutions below

0
On BEST ANSWER

You can instantiate your app via Flask(static_folder="assets")

Also see https://flask.palletsprojects.com/en/1.1.x/api/