Created
January 17, 2013 00:57
-
-
Save L1fescape/4552562 to your computer and use it in GitHub Desktop.
Display files from a directory in Flask
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/photos/<photo_name>', methods = [ 'GET' ]) | |
def photos(photo_name): | |
return send_from_directory("/path/to/photos", photo_name, as_attachment=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment