#!/usr/bin/env python

import cherrypy
from jinja2 import Environment, FileSystemLoader

j2_env = Environment(loader = FileSystemLoader('templates'))

class Root(object):
	@cherrypy.expose
	def index(self):
		template = j2_env.get_template('base.html')
		return template.render()

cherrypy.config.update('app.config')
cherrypy.tree.mount(Root(), '/', 'app.config')
cherrypy.engine.start()
cherrypy.engine.block()

@@ -20,394 +20,1454 @@
 on%0A%0A
-import cherrypy%0Afrom jinja2 import Environment, FileSystemLoader%0A%0Aj2_env = Environment(loader = FileSystemLoader('templates'))%0A%0Aclass Root(object):%0A%09@cherrypy.expose%0A%09def index(self):%0A%09%09template = j2_env.get_template('base.html')%0A%09%09return template.render()%0A%0Acherrypy.config.update('app.config')%0Acherrypy.tree.mount(Root(), '/', 'app.config')%0Acherrypy.engine.start()%0Acherrypy.engine.block
+from flask import Flask, redirect, render_template, request, session, url_for%0Afrom flask_oauthlib.client import OAuth, OAuthException%0A%0Aapp = Flask(__name__)%0Aapp.config%5B'FACEBOKK_APP_ID'%5D = ''%0Aapp.config%5B'FACEBOOK_APP_SECRET'%5D = ''%0Aapp.config%5B'GOOGLE_APP_ID'%5D = ''%0Aapp.config%5B'GOOGLE_APP_SECRET'%5D = ''%0Aapp.secret_key = 'development'%0Aoauth = OAuth(app)%0A%0Afacebook = oauth.remote_app(%0A%09'facebook',%0A%09consumer_key = app.config.get('FACEBOOK_APP_ID'),%0A%09consumer_secret = app.config.get('FACEBOOK_APP_SECRET'),%0A%09request_token_params = %7B'scope' : 'email'%7D,%0A%09base_url = 'https://graph.facebook.com',%0A%09request_token_url = None,%0A%09access_token_url = '/oauth/access_token',%0A%09authorize_url = 'https://www.facebook.com/dialog/oauth'%0A)%0A%0Agoogle = oauth.remote_app(%0A%09'google',%0A%09consumer_key = app.config.get('GOOGLE_APP_ID'),%0A%09consumer_secret = app.config.get('GOOGLE_APP_SECRET'),%0A%09request_token_params = %7B'scope' : 'https://www.googleapis.com/auth/userinfo.email'%7D,%0A%09base_url = 'https://www.googleapis.com/oauth2/v1/',%0A%09request_token_url = None,%0A%09access_token_url = 'https://accounts.google.com/o/auth2/token',%0A%09authorize_url = 'https://accounts.google.com/o/oauth2/auth'%0A)%0A%0A@app.route('/')%0Adef hello_world():%0A%09return render_template('base.html')%0A%0A@facebook.togengetter%0Adef get_facebook_oauth_token():%0A%09return session.get('facebook_token')%0A%0A@google.tokengetter%0Adef get_google_oauth_token():%0A%09return session.get('google_token')%0A%0Aif __name__ == '__main__':%0A%09app.run
 ()%0A
+%0A

Switch to Flask, add oauth