[英]a Django problem: Invalid block tag on line 17: 'static'. Did you forget to register or load this tag?
I am reading ,in 4.2 section I got a bug,but I code exactly as it appears in the book.And I did wrire<% load staticfiles %>.我正在阅读,在 4.2 部分我遇到了一个错误,但我的代码与书中出现的完全一样。而且我确实写了<% load staticfiles %>。 django version 2.1 python version 3.7 this is the file directory index.html
django version 2.1 python version 3.7这是文件目录 index.html
this is settings.py这是settings.py
this is also settings.py这也是 settings.py
this is console and it shows that there is a bug这是控制台,它显示有一个错误
You are currently using <% load staticfiles %>
which is wrong .您当前正在使用
<% load staticfiles %>
这是错误的。
Instead you should use {% load static %}
相反,您应该使用
{% load static %}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.