Skip to content

Instantly share code, notes, and snippets.

@doobeh
Last active August 29, 2018 15:33
Show Gist options
  • Save doobeh/7fd661088fb25eee332dbcda030c679b to your computer and use it in GitHub Desktop.
Save doobeh/7fd661088fb25eee332dbcda030c679b to your computer and use it in GitHub Desktop.
import os
@app.route('/uploads', defaults={'page': 'index'})
@app.route('/uploads/<path:page>')
def show(page):
try:
return send_from_directory(os.path.join(app.static_folder, 'xxxx'), page)
except IOError:
abort(404)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment