title: Pyramid - Dynamically assign template to view
body: <p>In Pyramid, templates are statically assigned to view with</p>
  
  <pre><code>@view_config(renderer='templates/foo.pt')
  def my_view(request):
      return {'foo':1, 'bar':2}
  </code></pre>
  
  <p>However, in some cases, we want to set different template for each user. For example, <code>user1</code> use templates from <code>templates/style1/xxx.pt</code> and <code>user2</code> use templates from <code>templates/style2/xxx.pt</code>. Thus, we need a way to dynamically pass templates to views, instead of configure them statically.</p>
  
  <p>Is there anyway to do the task elegantly?</p>