Skip to content

Instantly share code, notes, and snippets.

@LarsBergqvist
Created September 3, 2016 19:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save LarsBergqvist/97a4e93dd2d3f454d343d074ac9eaaa8 to your computer and use it in GitHub Desktop.
Flask routes with authorization
@app.route('/api/secret')
@requires_authorization
def api_secret():
return jsonify({'message':get_secret_message()})
@app.route('/')
@requires_authorization
def index():
return render_template('index.html', message=get_secret_message())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment