Skip to content

Instantly share code, notes, and snippets.

@L1fescape
Created January 17, 2013 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save L1fescape/4552562 to your computer and use it in GitHub Desktop.
Save L1fescape/4552562 to your computer and use it in GitHub Desktop.
Display files from a directory in Flask
@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