Bummer! You have been redirected as the page you requested could not be found.

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

flask CSRF token problem

Using Flask WTF.

{{ form.hidden_tag() }} in the html for a form template, but i am seeing CSFR Token priting out on the browser. Have inspected the element:

<label for="csrf_token">Csrf Token</label> == $0 <input id="csrf_token" name="csrf_token" placeholder="Csrf Token" type="hidden" value="1475011760##067826c4e1d9ce6d602eea692b337b2d6b5407e5"> == $0

can anyone see anything odd there?

anyone had this issue before?

James

Tried setting debug to false to see if that was the issue, thought it might be shown in debug mode, which would actually make sense in a way but nope

I had this in my html template

{% for field in form %} {{ field.label }} (1) {{ field(placeholder=field.label.text) }} {% endfor %}

the statement at (1) was rendering CSRF Token to the browser.

incidently, I seems that the for loop above, if you remove the field.label part, does indeed make a html element for the csrf token, seemingly without explicitly stating {{ field.hidden_tags() }}