当我运行代码时,我得到了错误。python3 manage.py运行服务器
/ 'staticfiles‘处的TemplateSyntaxError不是已注册的标记库。必须是以下之一: admin_list admin_modify admin_urls cache i18n l10n log propeller Request方法: GET请求URL:http://127.0.0.1:8000/ Django版本: 3.0异常类型: TemplateSyntaxError异常值:
“‘staticfiles”不是已注册的标记库。必须是以下内容之一: /home/sggs/neerajbyte/Env-10-DeC/lib/python3.7/site-packages/django/template/defaulttags.py in admin_list admin_modify admin_urls i18n l10n日志推进器静态tz异常位置:/home/sggs/neerajbyte/Env-10-DeC/lib/python3.7/site-packages/django/template/defaulttags.py in Python,第1025行Python可执行文件:/home/sggs/neerajbyte/Env-10-DeC/i18n/python3
发布于 2019-12-11 00:27:40
使用{% load static %}而不是{% load staticfiles %},请参见https://docs.djangoproject.com/en/2.2/intro/tutorial06/#customize-your-app-s-look-and-feel
发布于 2019-12-11 00:39:37
staticfiles现在已被弃用,您必须将其作为{% load static %}加载,而不是旧的{% load static from staticfiles %}方式
检查备注
staticfiles和admin_static模板标记库的3.0版本说明将被删除。
https://stackoverflow.com/questions/59271279
复制相似问题