2

This is my very first post, so excuse me for any mistakes...

I'm building a Flask App and using Flask Bootstrap, but I can't find out why I'm getting this error since this method belongs to the base.html template of the flask-bootstrap package.

File "c:\users\diego\documents\repositorios\simpleiotserver\venv\lib\site-packages\flask_bootstrap\templates\bootstrap\base.html", line 15, in block "styles"

jinja2.exceptions.UndefinedError: 'bootstrap_find_resource' is undefined

Seems like everything was done as it should and I can't find the mistake by myself.

Here's the code...

from flask_bootstrap import Bootstrap
from config import config

bootstrap = Bootstrap()


def create_app(config_name):
    app = Flask(__name__)
    bootstrap.init_app(app)

    from .main import main as main_blueprint
    app.register_blueprint(main_blueprint)

    from .api_v1 import api_v1 as api_v1_blueprint
    app.register_blueprint(api_v1_blueprint)

    return app
Diego Medeiros
  • 463
  • 5
  • 9

4 Answers4

3

This problem occurred for me because i installed two library bootstrap-flask and flask_bootstrap, I uninstall flask_bootstrap and then uninstall flask_bootstrap then install flask_bootstrap again, that work.

henrry
  • 486
  • 6
  • 25
1

I've created another virtual environment and checked on the Flask instance configurations.

Probably some package was missing. It all works fine now.

Diego Medeiros
  • 463
  • 5
  • 9
1

I had the same issue and what i did was pip uninstall flask_bootstrap to remove flask bootstrap and reinstalled with pip install flask_bootstrap. It worked for me. Sometime these issues occur since the Operating system may delete some files or a user operation may delete some files.

Boogie
  • 350
  • 3
  • 8
0

To solve a similar issue I had, I run the following commands on my main Terminal not on my editor Terminal. $pip uninstall flask_bootstrap to uninstall the flask_bootstrap I had then $pip install flask_bootstrap to reinstall it back. And sometimes after doing the installations and the problem persists, you just need to restart your editor.

Denis
  • 21
  • 3
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 02 '22 at 19:58