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

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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -