jmrivas86/django-json-widget

render() error with Django 2.1

Closed this issue · 4 comments

  • django-json-widget version: 0.1.1
  • Django version: 2.1
  • Python version: 3.6.5
  • Operating System: Linux

Description

Trying to use the widget in Django 2.1. When using Django 2.0.8 - it works fine. I noticed that froala also had/has this issue-> this may be the cause.

What I Did

Error Occurs: render() got an unexpected keyword argument 'renderer'

Request Method: | GET
-- | --
http://xxxxxxxxxxxxxxxxxxxxxxxxxxx.vfs.cloud9.ap-southeast-1.amazonaws.com/admin/api/inftoken/test_5Fdb59148644095ac4df829c4378125001d3462a6cf4565b54b7d16e90bb/change/
2.1
TypeError
render() got an unexpected keyword argument 'renderer'
/usr/local/lib64/python3.6/site-packages/django/forms/boundfield.py in as_widget, line 93
/usr/bin/python36
3.6.5
['/home/ec2-user/environment/api',  '/usr/lib64/python3.6',  '/usr/lib64/python3.6/lib-dynload',  '/home/ec2-user/.local/lib/python3.6/site-packages',  '/usr/local/lib64/python3.6/site-packages',  '/usr/local/lib/python3.6/site-packages',  '/usr/lib64/python3.6/dist-packages',  '/usr/lib/python3.6/dist-packages']
Sat, 25 Aug 2018 17:38:07 +1000

Trace:

screen

moas commented

render method signature was changed in django 2.1
My solution for quickly fix create your local widget base on django-json-widget and override method

xeor commented

This is causing issues for us as well... @maos.. If you have a fix? Can you share it? Maybe a pull-request?

xeor commented

Fixed this in #10.. Not sure how it works with old versions of django tho.. At least its a quick fix for someone else

fixed in PR #8