0

I am trying to do the following

{% block csslinks %} 
    <link rel="stylesheet" type="text/css" href="{% static 'hello/style.css' %}">
{% endblock %}

I know it is impossible, but what are the alternatives? The was a similar question at Django : Is it impossible to static tag into block tag?

I was suggested there to {% load staticfiles %} didn`t answer what to write here?

{% block csslinks %} 
    <link rel="stylesheet" type="text/css" href="what to write here to include css?">
{% endblock %}
Community
  • 1
  • 1
Sashko Lykhenko
  • 1,554
  • 4
  • 20
  • 36

1 Answers1

2

I dont have any problem with

{% block csslinks %} 
   <link rel="stylesheet" type="text/css" href="{% static 'hello/style.css' %}">
{% endblock %}

so long as {% load staticfiles %} is on the top of the same template..

doniyor
  • 36,596
  • 57
  • 175
  • 260