title: IndexError: string index out of range - Django - Why?
body: <p>I have this simple view function: </p>
  
  <pre><code>def location(request,locname,lid):
      try: 
         location = Location.objects.get(id=lid)                
         return render_to_response('location.html',{'location':location},context_instance=RequestContext(request))
      except Location.DoesNotExist:     
         return render_to_response('404.html',{},context_instance=RequestContext(request)) #&lt;-- error line
  </code></pre>
  
  <p>But I am getting <code>IndexError: string index out of range</code> only on the production server.</p>
  
  <p>Error line is on the last line.</p>
  
  <p>What am I doing wrong here?</p>