It was kind of a silly problem, but in case somebody comes by here I figure it's worth having a an answer for this problem.
Basically, since I was using WTForms
for all of my submissions and whatnot, the above code was very nearly correct. The only change I needed to make (Which WTForms seems to require for csrf authentication) was to add this line:
app.config["SECRET_KEY"] = "secret_key"
Above the connect command.