Connected flask-bootstrap to the project. I registered everything and did not change the contents of the base.html file which is located in the bootstrape. I run gives an error

werkzeug.routing.BuildError: Could not build url for endpoint '/static' with values ['filename']. Did you mean 'static' instead? 

then changed the inscriptions of bootstrap.static in the base.html file to static, but still gives an error at startup

 {{ url_for('static', filename='css/normalize.css') }} 

url_for the first parameter is a folder and the second way can something wrong do?

    1 answer 1

    Indicate in the configuration or initialization file what STATIC is and where it is located.

    In url_for 'static' is not a folder, but the name view. This view is already in flask by default, but you need to set the path to your static files in the configuration so that they can work.

    In configuration.py (or whatever your configuration file is called):

     PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) STATICFILES_DIRS = (os.path.join(PROJECT_ROOT, "static")) 

    and in __init__.py at the root of the project:

     import configuration app = Flask(__name__) app.config.from_object(configuration)