python - How to use a Django include tag for a separate HTML template? -


i trying use include django template tag, , inside reference template handles format of form. when reference though inside template outputs each of dynamic parts, each character per new line, strange. example here snippet of output:

<form action="/admin/events/create_submit/" method="post">      <div class="fieldwrapper">          : &lt;     </div>      <div class="fieldwrapper">          : l     </div>      <div class="fieldwrapper">           :     </div>      <div class="fieldwrapper">          : &gt;     </div> 

...

expected output

<form action="/admin/events/create_submit/" method="post">          <div class="fieldwrapper">            <li><label>field</label><input type="text" /></li>         </div> 

...

i realise markup on li inside div incorrect trying understand why html being encoded , each character split new line inside template div , prefixed colon ":"

the template trying render this:

<form action="{{action}}" method="post"> {% field in form %}     <div class="fieldwrapper">         {{ field.errors }}         {{ field.label_tag }}: {{ field }}     </div> {% endfor %}     <p><input type="submit" value="submit" /></p> </form> 

and reference include template this:

{% include "forms/form_template.html" %} 

does know or m why causing each dynamic piece output per character on each line?

tia

andrew

form string rather form object, , iterating on string yields individual characters.


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -