简体   繁体   中英

TemplateSyntaxError at 'bootstrap4' is not a registered tag library. Must be one of: bootstrap is installed and in INSTALED_APPS

I am trying to use bootstrap_datepicker_plus and to do that I need bootstrap4 . I have installed it. when I run pipenv run pip freeze , I see:

django-bootstrap==0.2.4
django-bootstrap-datepicker-plus==3.0.5
django-bootstrap4==2.3.1
django-compressor==2.4
django-jquery==3.1.0

and I have in settings.py:

INSTALLED_APPS = [
"bootstrap4",
"bootstrap_datepicker_plus",

But I still see

TemplateSyntaxError at /myapp/
'bootstrap4' is not a registered tag library. Must be one of:

when I include {% load bootstrap4 %} in my template. Does anyone have an idea of why the tag is not registered? I have restarted the server.

Django allows you to use different settings for different environments. My project was using this but left the settings.py file there which was not being used. There was a base.py file in the settings folder that I should have been editing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM