Error 1: ModuleNotFoundError: No module named ‘django.core.urlresolvers’
1 ModuleNotFoundError: No module named 'django.core.urlresolvers'
Solution: find the wrong file according to the prompt, and change all import django.core.urlresolvers to import django.urls
import django.core.urlresolvers
#change to
import django.urls
Error 2: TypeError: __init__() missing 1 required positional argument: ‘on_delete’
TypeError: __init__() missing 1 required positional argument: 'on_delete'
Solution: This is basically an error in models. Foreignkey() in the models file. Add on in parentheses according to the Django document_delete=models.CASCADE
Error 3: typeerror:__init__() takes 1 positional argument but 6 were given
TypeError: __init__() takes 1 positional argument but 6 were given
Solution: hint that the file xadmin\views\dashboard.py, find
forms.Field.__init__(self, required, widget, label, initial, help_text, *args, **kwargs)
change to
forms.Field.__init__(self)
forms.Field.__init__(self, required, widget, label, initial, help_text, *args, **kwargs)
#change to
forms.Field.__init__(self)
Error 4: ImportError: cannot import name ‘login’ from ‘django.contrib.auth.views’
ImportError: cannot import name 'login' from 'django.contrib.auth.views'
Solution: The hint is in xadmin\views\website.py”, line 5, in <module>
from django.contrib.auth.views import login
find the location, and then change
from django.contrib.auth.views import login
from django.contrib.auth.views import logout
to
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.views import login
from django.contrib.auth.views import logout
#change to
from django.contrib.auth import authenticate, login, logout
Error 5: ImportError: cannot import name ‘QUERY_TERMS’ from ‘django.db.models.sql.query’
ImportError: cannot import name 'QUERY_TERMS' from 'django.db.models.sql.query'
Solution: find the location in xadmin\plugins\filters.py”, line 10, in <module>
then change
from django.db.models.sql.query import LOOKUP_SEP, QUERY_TERMS
to
from django.db.models.sql.query import LOOKUP_SEP, Query
from django.db.models.sql.query import LOOKUP_SEP, QUERY_TERMS
#change to
from django.db.models.sql.query import LOOKUP_SEP, Query
Error 6: ImportError: cannot import name ‘password_reset_confirm’ from ‘django.contrib.auth.views’
ImportError: cannot import name 'password_reset_confirm' from 'django.contrib.auth.views'
Solution: in\xadmin\plugins\passwords.py”, line 4, in <module>
Find from django.contrib.auth.views import password_reset_confirm
change to from django.contrib.auth.views import PasswordResetConfirmView
in line 77, change return password_reset_confirm
to return PasswordResetConfirmView
from django.contrib.auth.views import password_reset_confirm
#change to
from django.contrib.auth.views import PasswordResetConfirmView
#line 77
return password_reset_confirm
#to
return PasswordResetConfirmView
Error 7: AttributeError: ‘Settings’ object has no attribute ‘MIDDLEWARE_CLASSES’
AttributeError: 'Settings' object has no attribute 'MIDDLEWARE_CLASSES'
Solution: in xadmin\plugins\language.py”, line 24, in <module>
if settings.LANGUAGES and ‘django.middleware.locale.LocaleMiddleware’ in settings.MIDDLEWARE_CLASSES:
change to if settings.LANGUAGES and ‘django.middleware.locale.LocaleMiddleware’ in settings.MIDDLEWARE:
if settings.LANGUAGES and 'django.middleware.locale.LocaleMiddleware' in settings.MIDDLEWARE_CLASSES:
#change to
if settings.LANGUAGES and 'django.middleware.locale.LocaleMiddleware' in settings.MIDDLEWARE:
Other errors are modulenotfounderror: no module named, just install the corresponding module according to the prompt. If it is not installed, it may be that the module name is written incorrectly