python - why would I be getting Invalid block tag: 'static' error? -


this head of of base.html:

{% load staticfiles %}  <head>  <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />     <!-- css foundation - base of client side --> <link rel="stylesheet" href="{% static 'css/foundation.css' %}" />  <!-- css smooth div scroll --> <link rel="stylesheet" type="text/cs' %}" href="{% static 'top_scroll/css/smoothdivscroll.css' %}" />  <!-- css custom --> <link rel="stylesheet" href="{% static 'css/custom.css' %} />  <script src="{% static 'js/vendor/modernizr.js' %}"></script> </head>` 

this part body, statics files above loading correctly, have images in body want load, located in same folder have written code in file , used {% include "images.html" %} add them base.

ex. <img src="{% static 'top_scroll/images/demo/field.jpg' %}" alt="demo image" id="field" /> <img src="{% static 'top_scroll/images/demo/gnome.jpg' %}" alt="demo image" id="gnome" /> <img src="{% static 'top_scroll/images/demo/pencils.jpg' %}" alt="demo image" id="pencils" /> <img src="{% static 'top_scroll/images/demo/golf.jpg' %}" alt="demo image" id="golf" />

above pretty of code on image html file, know why keep getting invalid block tag: 'static' error? top of base.html has {% load staticfiles %} django require on every file has static function, if called text inclusion?

yes, should {% load staticfiles %} in every template uses {% static %} tag.

excerpt documentation {% include %} tag:

the include tag should considered implementation of “render subtemplate , include html”, not “parse subtemplate , include contents if part of parent”. means there no shared state between included templates – each include independent rendering process.


Comments

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -