title: Failed lookup for key [page] in u"[{'False': False, 'None': None, 'True': True}, {}, {}]"
body: <p>When I try to navigate to a page, which uses this article function view in my news/views.py file, it is coming up with this error. I tried debugging the view, and it seems the template, and context are both good, so I am not sure why this is happening. </p>
  
  <p>news/views.py</p>
  
  <pre><code>def article(request, a_slug):
      a_slug = a_slug.strip('/')
  
      articles = Article.objects.get(slug=a_slug)
      recent = Article.objects.all()
  
      if request.method == "POST":
          form = NewsForm(request.POST)
  
          if form.is_valid():
              cleaned_data = NewsForm.cleaned_data
  
      else:
          form = NewsForm()
  
      context = {'article': articles, 'recent': recent, 'form': form}
      set_detail_context(request, context)
  
      template = "overrides/news.html"
  
      return render_to_response(template, context, context_instance=RequestContext(request))
  </code></pre>
  
  <p>news/urls.py</p>
  
  <pre><code>from django.conf.urls import url
  from . import views
  
  urlpatterns = [
      url(r'^article/(?P&lt;a_slug&gt;.*)/?$', views.article, name='article')
  ]
  </code></pre>
  
  <p>news/html.py</p>
  
  <pre><code>{% for article in articles %}
                  &lt;div class="container"&gt;
                      &lt;div class="row"&gt;
                          &lt;div class="col-md-12 article"&gt;
                              &lt;div class="col-md-5 col-xs-12"&gt;
                                  &lt;div class="article-image" style="background-image: url('{{ article.image }}');"&gt;&lt;/div&gt;
                              &lt;/div&gt;
                              &lt;div class="col-md-7 col-xs-12" id="content"&gt;
                                  &lt;h1&gt;{{ article.title }}&lt;/h1&gt;
                                  &lt;p&gt;{{ article.story|slice:"180" }}&lt;/p&gt;
                                  &lt;a href="article/{{ article.slug }}"&gt;
                                      &lt;button class="article-btn"&gt;
                                          READ MORE
                                      &lt;/button&gt;
                                  &lt;/a&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              {% endfor %}
  </code></pre>
  
  <p>Django source code where exception was raised</p>
  
  <pre><code>current = context
          try:  # catch-all for silent variable failures
              for bit in self.lookups:
                  try:  # dictionary lookup
                      current = current[bit]
                      # ValueError/IndexError are for numpy.array lookup on
                      # numpy &lt; 1.9 and 1.9+ respectively
                  except (TypeError, AttributeError, KeyError, ValueError, IndexError):
                      try:  # attribute lookup
                          # Don't return class attributes if the class is the context:
                          if isinstance(current, BaseContext) and getattr(type(current), bit):
                              raise AttributeError
                          current = getattr(current, bit)
                      except (TypeError, AttributeError) as e:
                          # Reraise an AttributeError raised by a @property
                          if (isinstance(e, AttributeError) and
                                  not isinstance(current, BaseContext) and bit in dir(current)):
                              raise
                          try:  # list-index lookup
                              current = current[int(bit)]
                          except (IndexError,  # list index out of range
                                  ValueError,  # invalid literal for int()
                                  KeyError,    # current is a dict without `int(bit)` key
                                  TypeError):  # unsubscriptable object
                              raise VariableDoesNotExist("Failed lookup for key "
                                                         "[%s] in %r",
                                                         (bit, current))  # missing attribute
  </code></pre>
  
  <p>Stacktrace: </p>
  
  <pre><code>Request Method: GET
  Request URL: http://localhost:8000/news/article/atlas-featured-in-retailing-today/
  
  Django Version: 1.9.1
  Python Version: 2.7.11
  Installed Applications:
  ('django.contrib.auth',
   'django.contrib.contenttypes',
   'django.contrib.humanize',
   'django.contrib.sessions',
   'django.contrib.sites',
   'django.contrib.messages',
   'django.contrib.staticfiles',
   'django.contrib.sitemaps',
   'filebrowser',
   'suit',
   'django.contrib.admin',
   'reversion',
   'classytags',
   'mptt',
   'inplaceeditform',
   'inplaceeditform_extra_fields',
   'contact',
   'home_content',
   'navigation',
   'page_content',
   'webapp',
   'webapp_admin',
   'testimonials',
   'products',
   'services',
   'news',
   'clients',
   'staff',
   'careers')
  Installed Middleware:
  ('django.contrib.sessions.middleware.SessionMiddleware',
   'django.middleware.common.CommonMiddleware',
   'django.middleware.csrf.CsrfViewMiddleware',
   'django.contrib.auth.middleware.AuthenticationMiddleware',
   'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
   'django.contrib.messages.middleware.MessageMiddleware',
   'django.middleware.clickjacking.XFrameOptionsMiddleware')
  
  
  Template error:
  In template /Users/timothybaney/Django_Projects/Atlas_Technology_Web/templates/overrides/news.html, error at line 0
     (Could not get exception message)   1 : {% extends 'detail_page.html' %}
     2 : {% load inplace_edit %}
     3 : {% load static %}
     4 : 
     5 : {% block extra-head %}
     6 :     {{ block.super }}
     7 :     &lt;link type='text/css' rel='stylesheet' href='/static/css/news.css'&gt;
     8 : {% endblock %}
     9 : 
     10 : 
  
  
  Traceback:
  
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
    149.                     response = self.process_exception_by_middleware(e, request)
  
  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
    147.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
  
  File "/Users/timothybaney/Django_Projects/Atlas_Technology_Web/news/views.py" in article
    55.     return render_to_response(template, context, context_instance=RequestContext(request))
  
  File "/usr/local/lib/python2.7/site-packages/django/shortcuts.py" in render_to_response
    45.             using=using)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
    114.                         template_name, context, context_instance, dirs, dictionary)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/engine.py" in render_to_string
    244.             return t.render(context_instance)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in render
    206.                     return self._render(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in _render
    197.         return self.nodelist.render(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in render
    988.                 bit = node.render_annotated(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in render_annotated
    955.             return self.render(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
    173.         return compiled_parent._render(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in _render
    197.         return self.nodelist.render(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in render
    988.                 bit = node.render_annotated(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in render_annotated
    955.             return self.render(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
    173.         return compiled_parent._render(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in _render
    197.         return self.nodelist.render(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in render
    988.                 bit = node.render_annotated(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in render_annotated
    955.             return self.render(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
    69.                 result = block.nodelist.render(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in render
    988.                 bit = node.render_annotated(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in render_annotated
    955.             return self.render(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
    69.                 result = block.nodelist.render(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in render
    988.                 bit = node.render_annotated(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in render_annotated
    955.             return self.render(context)
  
  File "/Users/timothybaney/Django_Projects/Atlas_Technology_Web/inplaceeditform/tag_utils.py" in render
    104.         context = self.prepare_context(args, kwargs, context)
  
  File "/Users/timothybaney/Django_Projects/Atlas_Technology_Web/inplaceeditform/templatetags/inplace_edit.py" in prepare_context
    99.         obj = Variable(obj_context).resolve(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in resolve
    846.             value = self._resolve_lookup(context)
  
  File "/usr/local/lib/python2.7/site-packages/django/template/base.py" in _resolve_lookup
    901.                                                        (bit, current))  # missing attribute
  
  Exception Type: VariableDoesNotExist at /news/article/atlas-featured-in-retailing-today/
  Exception Value: Failed lookup for key [page] in u"[{'False': False, 'None': None, 'True': True}, {}, {}]"
  </code></pre>
  
  <p>inplace_edit.py</p>
  
  <pre><code>register = Library()
  
  
  def inplace_js(context, activate_inplaceedit=True, toolbar=False):
      request = context['request']
      request.inplace_js_rendered = True
      return {
          'STATIC_URL': get_static_url(),
          'ADMIN_MEDIA_PREFIX': get_admin_static_url(),
          'activate_inplaceedit': activate_inplaceedit,
          'auto_save': json.dumps(inplace_settings.INPLACEEDIT_AUTO_SAVE),
          'event': inplace_settings.INPLACEEDIT_EVENT,
          'disable_click': json.dumps(inplace_settings.INPLACEEDIT_DISABLE_CLICK),
          'toolbar': toolbar,
          'enable_class': inplace_settings.INPLACE_ENABLE_CLASS,
          'success_text': inplace_settings.INPLACEEDIT_SUCCESS_TEXT,
          'unsaved_changes': inplace_settings.INPLACEEDIT_UNSAVED_TEXT,
          'inplace_get_field_url': inplace_settings.INPLACE_GET_FIELD_URL or reverse('inplace_get_field'),
          'inplace_save_url': inplace_settings.INPLACE_SAVE_URL or reverse('inplace_save'),
          'field_types': inplace_settings.INPLACE_FIELD_TYPES,
          'focus_when_editing': json.dumps(inplace_settings.INPLACE_FOCUS_WHEN_EDITING),
          'inplace_js_extra': getattr(request, 'inplace_js_extra', '')
      }
  register.inclusion_tag("inplaceeditform/inplace_js.html", takes_context=True)(inplace_js)
  
  
  def inplace_css(context, toolbar=False):
      request = context['request']
      request.inplace_css_rendered = True
      return {
          'STATIC_URL': get_static_url(),
          'ADMIN_MEDIA_PREFIX': get_admin_static_url(),
          'toolbar': toolbar,
          'inplace_js_extra': getattr(request, 'inplace_css_extra', '')
      }
  register.inclusion_tag("inplaceeditform/inplace_css.html", takes_context=True)(inplace_css)
  
  
  def inplace_static(context):
      return {
          'STATIC_URL': get_static_url(),
          'ADMIN_MEDIA_PREFIX': get_admin_static_url(),
          'toolbar': False,
          'request': context['request']
      }
  register.inclusion_tag("inplaceeditform/inplace_static.html", takes_context=True)(inplace_static)
  
  
  #to old django versions
  def inplace_media(context):
      return inplace_static(context)
  register.inclusion_tag("inplaceeditform/inplace_static.html", takes_context=True)(inplace_media)
  
  
  def inplace_toolbar(context):
      return {
          'STATIC_URL': get_static_url(),
          'ADMIN_MEDIA_PREFIX': get_admin_static_url(),
          'toolbar': True,
          'request': context['request']
      }
  register.inclusion_tag("inplaceeditform/inplace_static.html", takes_context=True)(inplace_toolbar)
  
  
  class InplaceEditNode(RenderWithArgsAndKwargsNode):
  
      def prepare_context(self, args, kwargs, context):
          expression_to_show = args[0]
          tokens_to_show = expression_to_show.split('|')
          obj_field_name, filters_to_show = tokens_to_show[0], '|'.join(tokens_to_show[1:])
          obj_field_name_split = obj_field_name.split(".")
          obj_context = '.'.join(obj_field_name_split[:-1])
          field_name = obj_field_name_split[-1]
          obj = Variable(obj_context).resolve(context)
          adaptor = kwargs.get('adaptor', None)
          class_adaptor = get_adaptor_class(adaptor, obj, field_name)
          request = context.get('request')
  
          config = class_adaptor.get_config(request, **kwargs)
  
          adaptor_field = class_adaptor(request, obj, field_name,
                                        filters_to_show,
                                        config)
  
          context = {
              'adaptor_field': adaptor_field,
          }
          return context
  
  
  @register.tag
  def inplace_edit(parser, token):
      args, kwargs = parse_args_kwargs(parser, token)
      return InplaceEditNode(args, kwargs, 'inplaceeditform/inplace_edit.html')
  
  
  @register.tag(name='eval')
  def do_eval(parser, token):
      "Usage: {% eval %}1 + 1{% endeval %}"
  
      nodelist = parser.parse(('endeval',))
  
      class EvalNode(template.Node):
          def render(self, context):
              return template.Template(nodelist.render(context)).render(template.Context(context))
      parser.delete_first_token()
      return EvalNode()
  </code></pre>