'ascii' codec can't decode byte (problem when using django)

后端 未结 2 1690
有刺的猬
有刺的猬 2021-01-27 01:32

I wrote a simple html parsing class in python and it seems to work fine and then I try to use it with django and I get this error:

\'ascii\' codec can\'t decode          


        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-27 02:05

    okay, I got it. All I needed to do was include # -*- coding: utf-8 -*- in the django view as well and that solved it!

提交回复
热议问题