How do i use Django and UTF-8 content-type for tem

2019-07-10 03:16发布

When I do:

return render_to_response()

in Django. How do I set the content-type to UTF-8? So that everything displayed is UTF-8?

1条回答
Fickle 薄情
2楼-- · 2019-07-10 03:51

django use UTF-8 as default encoding, but this can be modified with settings.DEFAULT_CHARSET.

Be sure, in your HTML template, to set UTF-8 for the HTML page also :

<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 
查看更多
登录 后发表回答