Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Build a Social Network with Flask Takin' Names Login View

Duplicated DOM values for the "csrf_token" in login.html

I got some odd thing in my DOM for login view. For some reason, my form has the additional field with csrf_token data. However, it has already existed as the input field out of form. The problem is that I have useless div block in my form with duplicated data. Is it the appropriate behavior of flask forms? My Python code below: <form name="login_form" action="" method="POST" class="form"> <label>Please, enter your login data</label> {{ form.hidden_tag() }} {% for field in form %} {{ render_field(field) }} {% endfor %} <button type="submit" id="submit">Login</button> </form>

HTML responce of my form below: <form name="login_form" action="" method="POST" class="form"> <label>Please, enter your login data</label> <input id="csrf_token" name="csrf_token" type="hidden" value="IjgwYTBhNWJkNTQxMDhlNjY3Mzk1MDZiYmQ1MGQ4MWI1NmQyOTVkNTMi.DYsAdQ.4G1yjSqVL3H540_slsMhCIQWm3Y">

<div class="field">
    <input id="email" name="email" placeholder="Email" type="text" value="">
</div>

<div class="field">
    <input id="password" name="password" placeholder="Password" type="password" value="">
</div>

<div class="field">
    <input id="csrf_token" name="csrf_token" placeholder="CSRF Token" type="hidden" value="IjgwYTBhNWJkNTQxMDhlNjY3Mzk1MDZiYmQ1MGQ4MWI1NmQyOTVkNTMi.DYsAdQ.4G1yjSqVL3H540_slsMhCIQWm3Y">
</div>

        <button type="submit" id="submit">Login</button>
    </form>