xadmin添加小组件遇到TypeError at /xadmin/xadmin/userwidget/add/ render() got an unexpected keyword argument

时间:2024-03-20 22:56:08

xadmin添加小组件遇到TypeError at /xadmin/xadmin/userwidget/add/ render() got an unexpected keyword argument

找了半天,原因都是说因为Django升级到2.1后导致的,一共找到两种解决方案:

1、

pip uninstall django

pip install django==2.0.8,即可。

2、修改源码:进入xadmin安装路径,编辑xadmin/views/dashboard.py

#render() got an unexpected keyword argument 'renderer'
#修改bug, 添加renderer
#by prism 2018/10/4
def render(self, name, value, attrs=None, renderer=None):

 

xadmin添加小组件遇到TypeError at /xadmin/xadmin/userwidget/add/ render() got an unexpected keyword argument

 

另可参考以下博文,写的比较详细:https://coding.imooc.com/learn/questiondetail/qid/20768