Skip to content Skip to sidebar Skip to footer

How Do I Use Django And Utf-8 Content-type For Template?

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?

Solution 1:

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 :

<metahttp-equiv="Content-type"content="text/html; charset=utf-8" />

Post a Comment for "How Do I Use Django And Utf-8 Content-type For Template?"