您好,登錄后才能下訂單哦!
ModuleNotFoundError: No module named 'django.core.urlresolvers'
修改site-packages\xadmin-0.6.1-py3.6.egg\xadmin\models.py
將from django.core.urlresolvers import NoReverseMatch, reverse修改為from django.urls import NoReverseMatch, reverse
TypeError: __init__() missing 1 required positional argument: 'on_delete'
把content_type = models.ForeignKey(ContentType)修改為content_type = models.ForeignKey(ContentType,on_delete=models.CASCADE)
TypeError: __init__() takes 1 positional argument but 6 were given
把forms.Field.__init__(self, required, widget, label, initial, help_text, *args, **kwargs) 修改成forms.Field.__init__(self)
AttributeError: 'Settings' object has no attribute 'MIDDLEWARE_CLASSES'
把:
if settings.LANGUAGES and 'django.middleware.locale.LocaleMiddleware' in settings.MIDDLEWARE_ClASSES:
改成:
if settings.LANGUAGES and 'django.middleware.locale.LocaleMiddleware' in settings.MIDDLEWARE:
ModuleNotFoundError: No module named 'django.contrib.formtools'
pip uninstall django-formtools
pip install django-formtools==2.1
ImportError: cannot import name 'QUERY_TERMS'
在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
在Django2.1.1版本中把from django.db.models.sql.query import LOOKUP_SEP, QUERY_TERMS修改為:
from django.db.models.sql.query import LOOKUP_SEP, Query
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。