title: Block evaluation of template tags but not variables
body: <p>I am using Django's template engine to evaluate user-supplied template strings.  I would like to allow the users to use the variable mapping functionality, but not the tags or filters.</p>
  <p>For example:</p>
  <pre><code>from django.template import Context, Template
  
  user_template_string = &quot;V1: {{ var1 }}.  V2: {{ var2|truncatechars:5 }}.  {% if var3 %} yes {% else %} no {% endif %}&quot;
  template = Template(user_template_string)
  
  context = {'var1': 'One',
             'var2': '123456789',
             'var3': True}
  
  output = template.render(context=Context(context))
  # Desired output:
  # &quot;V1: One.  V2: 123456789.  {% if var3 %} yes {% else %} no {% endif %}&quot;
  </code></pre>
  <p>Is there a way to configure the template engine to render variables but ignore tags and filters?  Or is my best bet to sanitize the user input and try to strip out all tags and filters that they may include?</p>