关于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

相关文章
相关标签/搜索