Last active
August 29, 2015 14:01
-
-
Save rdegges/4e5bcc75417fbae3b274 to your computer and use it in GitHub Desktop.
Flask-Stormpath Quickstart
This file contains hidden or 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.py | |
~~~~~~ | |
A simple Flask-Stormpath app. | |
""" | |
from os.path import expanduser | |
from flask import Flask | |
from flask.ext.stormpath import StormpathManager, login_required | |
app = Flask(__name__) | |
app.config['SECRET_KEY'] = 'xxx' | |
app.config['STORMPATH_API_KEY_FILE'] = expanduser('~/.stormpath/apiKey.properties') | |
app.config['STORMPATH_APPLICATION'] = 'Flask Test' | |
stormpath_manager = StormpathManager(app) | |
@app.route('/') | |
def home(): | |
return 'home page!' | |
@app.route('/secret') | |
@login_required | |
def secret(): | |
return 'secret page!' | |
if __name__ == '__main__': | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment