Rigoberto Molina Rigoberto Molina - 1 year ago 332
Python Question

Flask UnicodeDecodeError


UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 24: ordinal not in range(128)

So basically I have a Flask app where users fill a sign up form and it renders a new page.

Here's the code:

render_template('signUpSuccess.html', password="You should know, right?

Answer Source

Try passing a unicode object, not a str into render_template(), like so:

render_template('signUpSuccess.html', password=u"You should know, right? 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download