I have use Django as the back-end of my web system and the Angularjs material as the front-end.
In the front-end html files, I use the {% load staticfiles %}
tag to specify the static files path. such as the angular-material.css file:
{% load staticfiles %}
<link rel="stylesheet" href="{% static 'node_modules/angular-material/angular-material.css' %}"/>
When I put a to the html, it's md-svg-src attribute should be set to be specified as the svg file path. So how to set the svg file path as the value of md-svg-src without use {% load staticfiles %}
tag? Because the md-icon is frequently used in the html, put a {% load staticfiles %}
tag before every md-icon seems too ugly.
PS: my Angularjs script code is stored in a standalone js file index.js
, the $mdIconProvider config is in this file too. However, I haven't found that Django could translate its template tag {% load staticfiles %}
in js file.