title: unsupported format character '_' (0x5f) at index 1
body: <p>I am trying to get the dynamic class name in django  class based view .</p>
  
  <p>Here is my class .</p>
  
  <pre><code>class ProductDetailView(TemplateView):
          template_name = "%_%_details.html"
          def get_template_names(self,tmp_name,tmp_name2):
                  return [self.template_name % tmp_name,tmp_name2]
          def get_context_data(self, **kwargs):
              context = super(ProductDetailView, self).get_context_data(**kwargs)
              platform = self.request.GET.get('platform')
              if platform == "AMAZON":
                  asin =  self.request.GET.get('asin')
                  if asin:
                          #products = amazon.search(Keywords=q, SearchIndex='All')
                          products= amazon.lookup(ItemId=asin)
                          template_name = self.get_template_names('amazon','product')
                          context['products'] = products
  </code></pre>
  
  <p>I want to accees the template amazon_product_details.html .</p>
  
  <p>I am getting the error <code>unsupported format character '_' (0x5f) at index 1</code>  while accessing the above view .</p>
  
  <p>I tried urlib quoting also but that also doesn't work .</p>
  
  <p>Please do let me know what might I am doing wrong here .</p>