Testing HTTP Basic Auth in Flask

I created a quick & dirty admin page for a flask-based website I'm working on, and I had to add HTTP authentication support for it. Doing this is easy.

In the app, I add:

import auth

# ...

@app.route('/admin/', methods=['GET'])
@auth.requires_auth
def admin_page():
    # ... code to fetch info from ...

Page 1 / 17 »