In one of my django login templates, I h开发者_运维技巧ave a line:
<input type="hidden" name="next" value="{{ next|default:'{% url jobseeker_home %}' }}" />
And when I view the source code of the HTML page generated, I get the following for the above template line:
<input type="hidden" name="next" value="{% url jobseeker_home %}" />
Unfortunately, the {% url jobseeker_home %} is not being resolved. How can I solve this?
Thanks
Variables can be declared within a Django template:
{% url jobseeker_home as home_url %}
<input type="hidden" name="next" value="{{ next|default:home_url }}" />
精彩评论