1. 程式人生 > >django報錯must be str, not dict

django報錯must be str, not dict

request cloud vars reat var get code itl except

Django出現報錯

TypeError at /main/mmp/workticket/create/app/
must be str, not dict
Request Method: GET
Request URL:    http://127.0.0.1:8000/main/mmp/workticket/create/app/
Django Version: 2.1
Exception Type: TypeError
Exception Value:    must be str, not dict

最後定位的報錯是

D:\GITLAB\cloudnest\cloudnest\mmp\views.py in get
                print(‘Level1:‘ + x) ...
? Local vars

明顯的出現在print上,x是一個字典,不能直接打印,需要打印的話,強制轉換為str類型。

django報錯must be str, not dict