[英]TemplateSyntaxError at /en/admin/login/ 'staticfiles' is not a registered tag library. Must be one of:
[英]Django TemplateSyntaxError at / 'staticfiles' is not a registered tag library. Must be one of: admin_list admin_modify admin_urls
運行代碼時出現錯誤。 python3 manage.py runserver
/'staticfiles' 處的 TemplateSyntaxError 不是已注冊的標記庫。 必須是以下之一:admin_list admin_modify admin_urls cache i18n l10n log propeller static tz 請求方法:GET 請求 URL: http : //127.0.0.1 :8000/ Django 版本:3.0 異常類型:TemplateSyntaxError 異常值:
'staticfiles' 不是注冊的標簽庫。 必須是以下之一:admin_list admin_modify admin_urls cache i18n l10n log propeller static tz Exception Location: /home/sggs/neerajbyte/Env-10-DeC/lib/python3.7/site-packages/django/template/defaulttags.py in find_library ,第 1025 行 Python 可執行文件:/home/sggs/neerajbyte/Env-10-DeC/bin/python3
使用{% load static %}
而不是{% load staticfiles %}
,參見https://docs.djangoproject.com/en/2.2/intro/tutorial06/#customize-your-app-s-look-and-feel
staticfiles
現在已棄用,您必須將其加載為{% load static %}
而不是舊方式{% load static from staticfiles %}
檢查筆記
staticfiles和 admin_static 模板標簽庫將被刪除。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.