Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 552559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:30:45+00:00 2026-05-13T11:30:45+00:00

I am trying to use the include Django template tag, and inside it I

  • 0

I am trying to use the include Django template tag, and inside it I reference a template which handles the format of the form. When I reference this though inside my template it outputs each of the dynamic parts, each character per new line, it is really strange. For example here is a snippet of the output:

<form action="/admin/events/create_submit/" method="post">

    <div class="fieldWrapper">

        : &lt;
    </div>

    <div class="fieldWrapper">

        : l
    </div>

    <div class="fieldWrapper">


        : i
    </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 the markup on the li inside the div is incorrect but I am trying to understand why the html is being encoded and each character split into a new line inside the template div and prefixed with the colon “:”

The template which I am trying to render is this:

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

And I reference the include template like this:

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

Does anyone know or could help m as to why this would be causing each dynamic piece to output per character on each line?

TIA

Andrew

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:30:46+00:00Added an answer on May 13, 2026 at 11:30 am

    form is probably a string rather than a Form object, and iterating over a string yields its individual characters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to use an excpetion class which could provide location reference for XML parsing,
Whole this day I was trying to configure django on production server. I use
I'm trying to use the Server class from Cassini to include a basic web
I'm trying to use jQuery to format code blocks, specifically to add a <pre>
Let's say trying to use django.views.generic.create_update.create_object to allow the user to a blog entry
I am learning Django and I am trying to understand the use of models.py
Trying to use a guid as a resource id in a rest url but
While trying to use LINQ to SQL I encountered several problems. I have table
I' trying to use a Linq query to find and set the selected value
I trying to use ImageInfo and Jython to get information from a image on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.