Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tag inside tag in django template

I am trying to do something like the following:

{% include "default_form.html" with action="{% url 'settings' var1 var2 %}" %}

But it doesn't seem to be supported, as I get the following error:

Could not parse the remainder: '"{%' from '"{%'

Is there any way to achieve this within the template or do I need to define action in my view?

like image 543
NublicPablo Avatar asked Jun 04 '14 11:06

NublicPablo


1 Answers

The simplest solution would be:

{% url 'settings' var1 var2 as action_url %}

{% include "default_form.html" with action=action_url %}
like image 84
Kamil Rykowski Avatar answered Sep 24 '22 01:09

Kamil Rykowski