title: How can I get a Django template to use string formatting?
body: <p>I want the events.html template to format the string somehow, but I do not know how I would do that.  The way I have it below is how I would think it should work, but it doesn't.</p>
  
  <p>events.html</p>
  
  <pre><code>{% extends "base.html" %}
  {% block content %}
  {% for object in objects %}
  &lt;h1&gt;{{object.name}}&lt;/h1&gt;
  &lt;p&gt;When: {{ "It will take place in the year %s and the month %s" % (object.when.year, object.when.month) }}&lt;/p&gt;
  {% endfor %}
  {% endblock %}
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>from django.template.response import TemplateResponse
  import pdb
  from events.models import Event
  
  def home(request):
      objects = Event.objects.all()
      return TemplateResponse(request, 'events.html', {'objects': objects}); 
  </code></pre>