Skip to content
Myr

Correct imports in file upload example (#2230)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

The example code uses `flash` but doesn't import it. So the code as written doesn't work. This simply adds `flash` to the list of imports in the sample code.

authored by Adam Geitgey · committed by Adrian · parent de555c8 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:docs/patterns/fileuploads.rst+1 added-1 removed
19 unmodified lines
20specific upload folder and displays a file to the user. Let's look at the21bootstrapping code for our application::2223 import os24 from flask import Flask, request, redirect, url_for24 from flask import Flask, flash, request, redirect, url_for25 from werkzeug.utils import secure_filename2627 UPLOAD_FOLDER = '/path/to/the/uploads'28 ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
156 unmodified lines