I'm trying to set the initial value of a input field. In the template, I have
<input id="title" name="title" value={{ post_title }}>
where post_title
is a string. The weird thing is, if there is a whitespace in post_title
, it would be split and only the part before the whitespace would be displayed. For example, if post_title = "hello world"
, the rendered html is
<input id="title" name="title" value="hello" world>
Everything is ok without whitespaces in post_title
. I'm using Django 1.3.1 and python 2.6.
Django's template engine won't fix broken HTML.
<input id="title" name="title" value="{{ post_title }}">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With