/'staticfiles'中的Django TemplateSyntaxError不是注册的标记库。必须是以下之一:admin_list admin_modify admin_urls

时间:2019-12-10 16:07:53

标签: python django

运行代码时出现错误。 python3 manage.py runserver

TemplateSyntaxError位于/ “ staticfiles”不是注册的标签库。必须是以下之一: admin_list admin_modify admin_urls 快取 i18n 10 日志 螺旋桨 静态的 tz 请求方法:GET 要求网址:http://127.0.0.1:8000/ Django版本:3.0 异常类型:TemplateSyntaxError 异常值:
“ staticfiles”不是注册的标签库。必须是以下之一: admin_list admin_modify admin_urls 快取 i18n 10 日志 螺旋桨 静态的 tz 异常位置:在find_library的1025行中的/home/sggs/neerajbyte/Env-10-DeC/lib/python3.7/site-packages/django/template/defaulttags.py Python可执行文件:/ home / sggs / neerajbyte / Env-10-DeC / bin / python3

2 个答案:

答案 0 :(得分:1)

使用{% load static %}代替{% load staticfiles %},请参见https://docs.djangoproject.com/en/2.2/intro/tutorial06/#customize-your-app-s-look-and-feel

答案 1 :(得分:1)

staticfiles现在已弃用,您必须将其加载为{% load static %}而不是旧的{% load static from staticfiles %}

检查笔记