**
关于django.template.exceptions.TemplateSyntaxError: ‘staticfiles’ is not a registered tag library.
**
当我们在html中使用static模板时,会调用static, {% load static from staticfiles %}或者{% load staticfiles %}。因为版本问题,在django 2.1被弃用,django 3.0被移除,所以会出现报错:
django.template.exceptions.TemplateSyntaxError: 'staticfiles' is not a registered tag library. Must be one of:
admin_list
admin_modify
admin_urls
cache
i18n
l10n
log
static
tz
解决办法:
改为:
{% load static %}
ok啦!!