Quantcast
Channel: Pass variable to href template in Django 2 - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Starbody for Pass variable to href template in Django 2

You can just do: href="/static/{{ stylefolder }}">

View Article



Answer by willeM_ Van Onsem for Pass variable to href template in Django 2

Since you are in a template tag, you should not add the double curly brackets {{ .. }}, you can use the variablename instead, like:<link href="{% static stylefolder %}" rel="stylesheet"...

View Article

Pass variable to href template in Django 2

I have below function in my views.py Django 2 project and I am trying to pass the variable "stylefolder" from views.py to my base.html template in order to dynamically get the correct href in my link...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images