[英]“abc” is not a registered tag library. must be one of: “efg” | django
[英]Django 3.0.8 ' bootstrap' is not a registered tag library. Must be one of:
我想要一个自定义菜单,具体取决于您所属的组。 我正在使用 Django 3.0.8。 当我尝试创建我的 Templatetag 时,它会失败并显示:¨ TemplateSyntaxError at /accounts/login/ 'bootstrap' 不是已注册的标签库。 必须是以下之一: admin_list admin_modify admin_urls bootstrap_tags cache crispy_forms_field Krispy_forms_filters crispy_forms_tags crispy_forms_utils i18n l10n log static tz
模板渲染时出错在模板/home/saurabh/Documents/python projects/django-job-portal-master/job_portal/templates/accounts/login.html,第3行出错
'bootstrap' 不是注册的标签库。 必须是以下之一: admin_list admin_modify admin_urls bootstrap_tags cache crispy_forms_field Krispy_forms_filters crispy_forms_tags crispy_forms_utils i18n l10n log static tz
{% extends 'base.html' %}
{% load static %}
{% load bootstrap %}
{% block content %}
<section class="home-section section-hero inner-page overlay bg-image" style="background-image: url('images/hero_1.jpg');" id="home-section">
<div class="container">
<div class="row align-items-center justify-content-center">
<div class="col-md-12">
<div class="mb-5 text-center">
and the error comes in login.html file which says,
{% load bootstrap %}
你应该安装:
pip install django-bootstrap4
并再次运行它以显示结果。 我希望这会有所帮助。
在settings.py
中将引导程序添加到您的INSTALLED_APPS
列表中
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
#....other apps
'bootstrap3',
]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.