question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Admin widget error in Django 2.1

See original GitHub issue

When using the admin widget in Django 2.1 I get the following error:

'TypeError: render() got an unexpected keyword argument 'renderer'

By process of elimination, when I remove tags from the fieldset for my model the admin suddenly works again.

Django 2.1 and django-taggit 0.24.0

Traceback (most recent call last):
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/core/handlers/base.py", line 156, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/core/handlers/base.py", line 154, in _get_response
    response = response.render()
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/response.py", line 106, in render
    self.content = self.rendered_content
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/response.py", line 83, in rendered_content
    content = template.render(context, self._request)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/backends/django.py", line 61, in render
    return self.template.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 171, in render
    return self._render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 163, in _render
    return self.nodelist.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 163, in _render
    return self.nodelist.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/loader_tags.py", line 150, in render
    return compiled_parent._render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 163, in _render
    return self.nodelist.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/loader_tags.py", line 62, in render
    result = block.nodelist.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/defaulttags.py", line 209, in render
    nodelist.append(node.render_annotated(context))
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/loader_tags.py", line 188, in render
    return template.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 173, in render
    return self._render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 163, in _render
    return self.nodelist.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/defaulttags.py", line 209, in render
    nodelist.append(node.render_annotated(context))
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/defaulttags.py", line 209, in render
    nodelist.append(node.render_annotated(context))
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/defaulttags.py", line 309, in render
    return nodelist.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/defaulttags.py", line 309, in render
    return nodelist.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 937, in render
    bit = node.render_annotated(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 904, in render_annotated
    return self.render(context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 993, in render
    return render_value_in_context(output, context)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/template/base.py", line 972, in render_value_in_context
    value = str(value)
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/utils/html.py", line 397, in <lambda>
    klass.__str__ = lambda self: mark_safe(klass_str(self))
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/forms/boundfield.py", line 33, in __str__
    return self.as_widget()
  File "/Users/ahknight/.virtualenvs/milton/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/forms/boundfield.py", line 93, in as_widget
    renderer=self.form.renderer,
TypeError: render() got an unexpected keyword argument 'renderer'

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pfriedrixcommented, Sep 23, 2019

So, The same thing when I added to models TaggableManager it happened. toggit version is 0.22.2. But when I updated version to 1.1.0 it worked.

0reactions
jdufresnecommented, Dec 4, 2019

Sounds like this has been been fixed in recent version. Further, Django 2.1 is now EOL. If you can still trigger the error, please provide details.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using MultiValueField and MultiWidget in Django Admin Form ...
It seems like everything works alright, except that the validators that I've specified under RangeField.fields do not validate the form and I am ......
Read more >
Widgets - Django documentation
A widget is Django's representation of an HTML input element. The widget handles the rendering of the HTML, and the extraction of data...
Read more >
Django 2.1.2 update, admin interface broken: render() got an ...
After upgrading Django from 2.0.8 to 2.1.2, the admin interface no longer seems to work due to some problems with our widgets. This...
Read more >
Django Map Widgets Documentation
It is compatible with Django 1.6-2.1. ... Note: If you are using mapwidgets on the Django Admin, you don't need ... Fixed Python...
Read more >
Django Custom Widget With 3 Examples - Ihfazhillah
This tutorial is for django 1.8 and 2.1 versions. And you can found the code at https://gitlab.com/ihfazhillah/django-custom-widget-code.git and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found