File "C:\Python\Python37\lib\site-packages\django\db\backends\mysql\operations.py", line 146, in last_executed_query
query = query.decode(errors='replace')
AttributeError: 'str' object has no attribute 'decode'
解決方法:點到報錯信息最后一個py文件里(上面加粗的operations.py),找到以下內容,注釋掉:
# if query is not None:
query = query.decode(errors=‘replace’)