title: Python list append adding element twice
body: <p>I am new to Python and am trying out Django. I am seeing what is to me a strange behavior during a page request. I wrote my own class which extends the built-in <code>TemplateView</code> class so that I can override the <code>get_context_data</code> method of that class. In my new version of that method I am making changes to the <code>context</code> like so:</p>
  
  <pre><code>class adminUpload(TemplateView):
    template_name = "adminupload.tpl.html"
  
    def get_context_data(self,**kwargs):
      context = super(TemplateView, self).get_context_data(**kwargs)
  
      context['js_paths'] = webapp.settings.template['js_paths']
  
      logger.debug('adding')
      logger.debug( context['js_paths'] )
  
      context['js_paths'].append( '/static/path/to/js/file.js' )
  
      logger.debug( context['js_paths'] )
  
      return context
  </code></pre>
  
  <p>And in my url router I am passing requests to this class like so:</p>
  
  <pre><code>url(r'^adminupload$', front.adminUpload.as_view() ),
  </code></pre>
  
  <p>For some reason, each time I reload the page, my <code>context['js_paths']</code> list gets longer by one item, <code>'/static/path/to/js/file.js'</code> such that if I reload the page 5 times, the list will contain 5 items all appended to the end with that value. I can verify that the method is only being called once per request, and that the list does in fact seem to get bigger after each request by examining the debug log I setup.</p>
  
  <p>I must be missing something very simple, some kind of caching, not understanding something about template context. Any point in the right direction would be greatly appreciated.</p>