标签:confirm error: view auth plugin resolve string views lan
Xadmin 下载地址: https://github.com/sshwsfc/django-xadmin
遇见的错误
提示:ModuleNotFoundError: No module named ‘django.core.urlresolvers‘ ,
这是因为django2.1把from django.core.urlresolvers修改成了django.urls,如下图所示
forms.Field.__init__(self, required,widget, label, initial, help_text, *args, **kwargs) 修改为如图所示
# 将 website.py 中的 from django.contrib.auth.views import login from django.contrib.auth.views import logout # 修改为 from django.contrib.auth import authenticate, login, logout
# django2.1.1版本将xadmin\plugins\filters.py文件中的 from django.db.models.sql.query import LOOKUP_SEP, QUERY_TERMS # 修改为 from django.db.models.sql.query import LOOKUP_SEP, Query # 在Django2.0版本中把 from django.db.models.sql.query import LOOKUP_SEP, QUERY_TERMS # 修改为: from django.db.models.sql.query import LOOKUP_SEP from django.db.models.sql.constants import QUERY_TERMS
# 卸载旧版本 pip uninstall django-formtools # 安装新版本 pip install django-formtools
# 把xadmin\plugins\password.py中的 from django.contrib.auth.views import password_reset_confirm 修改为: from django.contrib.auth.views import PasswordResetConfirmView
再把位于75行左右 return后的 password_reset_confirm修改为 PasswordResetConfirmView,如下图所示:
# 将xadmin\plugins\language.py 中的 if settings.LANGUAGES and ‘django.middleware.locale.LocaleMiddleware‘ in settings.MIDDLEWARE_CLASSES: 修改为: if settings.LANGUAGES and ‘django.middleware.locale.LocaleMiddleware‘ in settings.MIDDLEWARE:
安装django-import_export模块 pip install django-import_export
标签:confirm error: view auth plugin resolve string views lan
原文地址:https://www.cnblogs.com/netalen/p/10987016.html