我是這個新手,我安裝了django-bootstrap3。 v5.3.1 將「bootstrap3」添加到我的設置文件中的INSTALLED_APPS參數 中,並開始在我的模板中引用{%load bootstrap3%}。我也重新啓動了django。但是,即時通知錯誤:有誰知道我可以解決這個問題?Django TemplateSyntaxError:找不到模板庫bootstrap3
TemplateSyntaxError at /jhgi/signup/
'bootstrap3' is not a valid tag library: Template library bootstrap3 not found, tried django.templatetags.bootstrap3,django.contrib.admin.templatetags.bootstrap3,django.contrib.staticfiles.templatetags.bootstrap3,django_extensions.templatetags.bootstrap3
Request Method: GET
Request URL: http://127.0.0.1:8000/jhgi/signup/
Django Version: 1.7.7
Exception Type: TemplateSyntaxError
Exception Value:
'bootstrap3' is not a valid tag library: Template library bootstrap3 not found, tried django.templatetags.bootstrap3,django.contrib.admin.templatetags.bootstrap3,django.contrib.staticfiles.templatetags.bootstrap3,django_extensions.templatetags.bootstrap3
Exception Location: /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/template/defaulttags.py in load, line 1119
Python Executable: /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4
Python Version: 3.4.2
Python Path:
['/Users/XXXX/PycharmProjects/XXXX',
'/Applications/PyCharm.app/helpers/pydev',
'/Users/xxxx/PycharmProjects/Companion',
'/Library/Frameworks/Python.framework/Versions/3.4/lib/python34.zip',
'/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4',
'/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/plat-darwin',
'/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/lib-dynload',
'/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages',
'/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/IPython/extensions']
Server time: Sun, 12 Apr 2015 20:47:32 +0000
Error during template rendering
In template /Users/xxxxx/PycharmProjects/Companion/templates/signup.html, error at line 5
'bootstrap3' is not a valid tag library: Template library bootstrap3 not found, tried django.templatetags.bootstrap3,django.contrib.admin.templatetags.bootstrap3,django.contrib.staticfiles.templatetags.bootstrap3,django_extensions.templatetags.bootstrap3
您確定它已添加到您的INSTALLED_APPS?因爲Django嘗試的模板庫似乎沒有包含bootstrap3。 – LaundroMat
嗨,是的,我試過重新啓動,並且bootstrap3包含在INSTALLED_APPS參數中。 – user2101984