How can I conditionally pass a value to a with variable in Django template?

I’m looking to pass a value to a variable based on a condition in my code. Here’s the pseudo code of what I’m trying to achieve:

{% include "includes/template.html" with info=if condition: a else: b %}

I’m wondering how I can accomplish this. Any suggestions or guidance would be greatly appreciated!

There are 2 ways I would do this.

  1. Put the if logic in the view code.
  2. Have 2 include statements wrapped in an if block, so
{% if condition %}
{% include "includes/template.html" with info=a %}
{% else %}
{% include "includes/template.html" with info=b %}
{% endif %}