Django3.0使用xadmin相關報錯解決

 首先安裝xadmin,pip install git+git://github.com/sshwsfc/xadmin.git@django2

,或者下載後放到項目根目錄都可以,直接運行會報錯,主要因爲
Django中six包已經移除,使用獨立的第三方包。
需要改的地方有:
requirements.txt中django-formtools==2.2需要升級到2.2版本,2.1版本會報錯

根目錄下sites.py中需要替換

from django.utils import six ==> import six

xadmin/models.py中以下需要替換

**from django.core.urlresolvers import NoReverseMatch, reverse ==> from django.urls import NoReverseMatch, reverse

**from django.utils.encoding import python_2_unicode_compatible, smart_text ==>

from six import python_2_unicode_compatible
from django.utils.encoding import smart_text

還有很多需要修改的,詳細參考這篇文章
https://www.cnblogs.com/xingfuggz/p/10142388.html

修改完了以後makemigration,migrate.
登錄後臺頁面報錯 'Media' object has no attribute 'add_js',參考文章
https://blog.csdn.net/jeekmary/article/details/88312004

運行過程中相關報錯,請參考文章
https://blog.csdn.net/jehon/article/details/84851611

https://blog.csdn.net/qq_29180565/article/details/101052698

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章