django3.0中xadmin
ModuleNotFoundError: No module named 'future'
pip install future
ImportError: cannot import name 'six' from 'django.utils'
第一步:pip install six
第二步:复制six.py
第三步:将six.py复制到django下面的utils文件夹下面
ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'
修改 xadmin下面的molels.py
from six import python_2_unicode_compatible
from django.utils.encoding import smart_text
ModuleNotFoundError: No module named 'django.contrib.staticfiles.templatetags'
from django.contrib.staticfiles.templatetags.staticfiles import static
改成
from django.templatetags.static import static
ModuleNotFoundError: No module named 'crispy_forms'
django-crispy-forms
在settings.py的app中引用
crispy_forms
ModuleNotFoundError: No module named 'django.contrib.formtools'
pip install django-formtools
ModuleNotFoundError: No module named 'httplib2'
pip install httplib2
ModuleNotFoundError: No module named 'import_export'
pip install django-import_export
\xadmin\filters.py:205: SyntaxWarning: "is" with a literal. Did you mean "=="?
'selected': self.lookup_exact_val is '',
\xadmin\filters.py:551: SyntaxWarning: "is" with a literal. Did you mean "=="?
'selected': (self.lookup_exact_val is '' and self.lookup_isnull_val is ''),
\xadmin\filters.py:551: SyntaxWarning: "is" with a literal. Did you mean "=="?
'selected': (self.lookup_exact_val is '' and self.lookup_isnull_val is ''),
对应的205行 551行中的is 修改成 ==
修改前
修改后
依赖包
asgiref==3.2.10
defusedxml==0.6.0
diff-match-patch==20200713
Django==3.0.8
django-cors-headers==3.4.0
django-crispy-forms==1.9.2
django-formtools==2.2
django-import-export==2.3.0
djangorestframework==3.11.0
et-xmlfile==1.0.1
future==0.18.2
httplib2==0.18.1
jdcal==1.4.1
MarkupPy==1.14
mysqlclient==2.0.1
odfpy==1.4.1
openpyxl==3.0.4
pytz==2020.1
PyYAML==5.3.1
six==1.15.0
sqlparse==0.3.1
tablib==2.0.0
xlrd==1.2.0
xlwt==1.3.0