-3

I am working on a project at work for taking in large excel files and spitting them out in PDF form.

My code is at https://github.com/haincha/Project

It has the template file and all.

For some reason I just can't find good documentation or I am terrible at life.

Figured it out

Code was working, was missing:

app.secret_key = 'some_secret'

Everything else was good.

flash(Markup(str(count) + " file(s) have been converted into PDF."))
return render_template("upload.html")

This is what happens when I am reading documentation after a long day.

haincha
  • 23
  • 1
  • 6
  • You need to include specifics of what you have tried. – Matt Healy Jul 08 '16 at 01:21
  • This is a completely valid question. Why would somebody write methods using flash into Flask 0.12.4 when it doesn't work. There is obviously an import statement missing from the code on: http://flask.pocoo.org/docs/0.12/patterns/fileuploads/ – Eamonn Kenny May 10 '18 at 11:03
  • It's corrected in version 1.0 which is (now) the latest stable version – Matt Healy May 10 '18 at 11:08

1 Answers1

5

You're not actually calling the flash function anywhere.

Following the example in the official documentation:

In your view function you need to call flash

flash('You were successfully logged in')

Only then will the call to get_flashed_messages in the Jinja template return any data.

Matt Healy
  • 18,033
  • 4
  • 56
  • 56