title: Django 1.10 KeyError at /admin/
body: <p>I have a Django app that was written in Django 1.7, that I am porting to a Docker app.  I'm using Django 1.10 in the container.</p>
  
  <p>When I browse to the /admin/ URI, I get the following exception:</p>
  
  <pre><code>KeyError at /admin/
  
  u'user'
  
  Request Method:     GET
  Request URL:        http://10.3.101.206:9000/admin/
  Django Version:     1.10
  Exception Type:     KeyError
  Exception Value:    
  
  u'user'
  
  Exception Location:     /usr/local/lib/python2.7/site-packages/django/template/context.py in __getitem__, line 75
  Python Executable:  /usr/local/bin/python
  Python Version:     2.7.12
  Python Path:    
  
  ['/var/www/django/labmgr',
   '/usr/local/lib/python27.zip',
   '/usr/local/lib/python2.7',
   '/usr/local/lib/python2.7/plat-linux2',
   '/usr/local/lib/python2.7/lib-tk',
   '/usr/local/lib/python2.7/lib-old',
   '/usr/local/lib/python2.7/lib-dynload',
   '/usr/local/lib/python2.7/site-packages']
  
  Server time:    Tue, 20 Dec 2016 21:43:21 -0800
  
  Error during template rendering
  
  In template /usr/local/lib/python2.7/site-packages/django/contrib/admin/templates/admin/index.html, error at line 58
  user
  
  48  {% endif %}
  49  &lt;/div&gt;
  50  {% endblock %}
  51  
  52  {% block sidebar %}
  53  &lt;div id="content-related"&gt;
  54      &lt;div class="module" id="recent-actions-module"&gt;
  55          &lt;h2&gt;{% trans 'Recent actions' %}&lt;/h2&gt;
  56          &lt;h3&gt;{% trans 'My actions' %}&lt;/h3&gt;
  57              {% load log %}
  58              {% get_admin_log 10 as admin_log for_user user %}
  59              {% if not admin_log %}
  60              &lt;p&gt;{% trans 'None available' %}&lt;/p&gt;
  61              {% else %}
  62              &lt;ul class="actionlist"&gt;
  63              {% for entry in admin_log %}
  64              &lt;li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}"&gt;
  65                  {% if entry.is_deletion or not entry.get_admin_url %}
  66                      {{ entry.object_repr }}
  67                  {% else %}
  68                      &lt;a href="{{ entry.get_admin_url }}"&gt;{{ entry.object_repr }}&lt;/a&gt;
  </code></pre>
  
  <p>The error appears to be in the Django code, and not my code, so I'm not sure what the problem is or how to fix it.</p>