Flask UnicodeDecodeError
Try passing a unicode
object, not a str
into render_template()
, like so:
render_template('signUpSuccess.html', password=u"You should know, right? 😛")
Sample program:
# coding: utf-8from flask import Flask, render_templateapp = Flask(__name__)@app.route('/')def root(): return render_template('signUpSuccess.html', password=u"You should know, right? 😛")if __name__=="__main__": app.run(debug=True)
template:
<html>password: {{ password }}</html>