Example #1
0
'''

from flask import Flask, jsonify, request, make_response, render_template
from flask.ext.stormpath import StormpathManager, login_required, user
from os import environ
from libperk import bulletin, perks, utils, access_control
import json
import wolframalpha
import praw

APP = Flask(__name__)
sakf = 'STORMPATH_API_KEY_FILE'
akpp = '/home/jbert/.stormpath/apiKey.properties'
APP.config['SECRET_KEY'] = # environ.get('PESK')
APP.config[sakf] = akpp  # environ.get('PEAKFILE')
APP.config['STORMPATH_APPLICATION'] = 'PerkEDU'
APP.config['STORMPATH_REDIRECT_URL'] = '/welcome'
'''
APP.config['STORMPATH_ENABLE_FACEBOOK'] = True
APP.config['STORMPATH_SOCIAL'] = {
    'FACEBOOK': {
        'app_id': # environ.get('PEFAK'),
        'app_secret': # environ.get('PEFAS'),
    }
}
'''

SPM = StormpathManager(APP)
CLI = wolframalpha.Client(environ.get('WFK'))
RED = praw.Reddit(user_agent='PerkEDU https://github.com/jamesalbert/PerkEDU')
	url_for,
)
from flask.ext.stormpath import (
	StormpathError,
	StormpathManager,
	User,
	login_required,
	login_user,
	logout_user,
	user,
)

app = Flask(__name__)
app.config['SECRET_KEY'] = 'nananananananana'
app.config['STORMPATH_API_KEY_FILE'] = 'apiKey-YVVIY4R3LM986736KU1OS4LNX.properties'
app.config['STORMPATH_APPLICATION'] = 'batman_splash'
app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0

stormpath_manager = StormpathManager(app)

@app.route('/')
def show_index():
	import netifaces
	interfaces = [interface for interface in netifaces.interfaces() if interface.find('wlan') != -1]
	return render_template('index.html', option_list=interfaces)

@app.route('/error')
def show_error():
	return render_template('error.html')

@app.route('/join', methods=['POST'])