django-xadmin background homepage add small component error resolution

Foreword
There is an add widget button on the homepage of xadmin. When it is opened, an error "render() got an unexpected keyword argument'renderer'" will be reported.
Environment:
python3.6
django 2.1.2
xadmin 2

Encounter problems

Click "Add widget" on the home page of xadmin backend, and an error appears: "render() got an unexpected keyword argument'renderer'"


Solution

Find xadmin/views/dashboard.py, and add a parameter renderer=None on line 36

# dashboard.py 
# 36行修改前
def render(self, name, value, attrs=None):

# 修改后
def render(self, name, value, attrs=None, renderer=None):

After the modification, refresh the page and click into it.

Guess you like

Origin blog.csdn.net/scyllake/article/details/109263818