關於Django與mysql的配置錯誤問題

錯誤:mysql

django2.2/mysql ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3

找到:找到base.py文件,註釋掉 base.py 中以下部分(35/36行)sql

#if version < (1, 3, 3): #raise ImproperlyConfigured("mysqlclient 1.3.3 or newer is required; you have %s" % Database.__version__)

此時仍會會報錯,報錯信息以下:django

AttributeError: ‘str’ object has no attribute ‘decode’

#找到operations.py文件(46行,版本不一樣行數不一樣哈~自個兒find一下),將decode改成encodeui

if query is not None: query = query.decode(errors='replace') return query #改成
if query is not None: query = query.encode(errors='replace') return query

問題解決,正常啓動!spa

相關文章
相關標籤/搜索