Skip to content

Instantly share code, notes, and snippets.

@rdegges
Last active August 29, 2015 14:01
Show Gist options
  • Save rdegges/4e5bcc75417fbae3b274 to your computer and use it in GitHub Desktop.
Save rdegges/4e5bcc75417fbae3b274 to your computer and use it in GitHub Desktop.
Flask-Stormpath Quickstart
"""
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