title: erase template cache
body: <p>I have a Django app where users can select between 2 interface modes, that mode affect some pages... for those pages I use different templates</p>
  
  <p>In urls.py I have something like this:</p>
  
  <pre><code>mode = Config.objects.get().mode
  urlpatterns = patterns('',
      url(r'^my_url/$', 'custom_view', {'template':'my_template.html', 'mode':mode} ),
  )
  </code></pre>
  
  <p>Then my view is something like this:</p>
  
  <pre><code>@render_to()
  def custom_view(request, template, mg=False, login=True):
      if mode:
          template = template + 'x' #I add an x to the template name to advice to django I that it should use the mode_2 template.
      return {'TEMPLATE':template}
  </code></pre>
  
  <p>My problem is when the user selects mode 2 (in my custom Configuration page), mode does not change until server is restarted (either apache or runserver.py is the same).</p>
  
  <p>I think this has to do something with cache, but I can't find how to erase that cache. (each time Config.mode is changed.)</p>