其他分享
首页 > 其他分享> > Media' object has no attribute 'add_css

Media' object has no attribute 'add_css

作者:互联网

'Media' object has no attribute 'add_css'
Request Method:     GET
Request URL:     http://localhost:8000/xadmin/
Django Version:     2.0.1
Exception Type:     AttributeError
Exception Value:     
'Media' object has no attribute 'add_css'
Exception Location:     /home/wuchao/PycharmProjects/mxonline3/extra_apps/xadmin/util.py in vendor, line 94
解决方案:
将util.py 中的86行

def vendor(*tags):方法体改为:
    css = {'screen': []}
    js = []
    for tag in tags:
        file_type = tag.split('.')[-1]
        files = xstatic(tag)
        if file_type == 'js':
            js.extend(files)
        elif file_type == 'css':
            css['screen'] += files
    return Media(css=css, js=js)

标签:no,Media,object,js,file,attribute,css
来源: https://www.cnblogs.com/tslam/p/16694155.html