Skip to content

Instantly share code, notes, and snippets.

View data-henrik's full-sized avatar

Henrik Loeser data-henrik

View GitHub Profile
@data-henrik
data-henrik / IBMCloud-AppID-OIDC-Flask.py
Created June 6, 2018 13:16
Use IBM Cloud App ID with OpenID Connect client in Python Flask app
# for full example visit https://github.com/IBM-Cloud/github-traffic-stats/blob/master/backend/ghstats.py
# as part of this tutorial: https://console.bluemix.net/docs/tutorials/serverless-github-traffic-analytics.html
# import all kinds of modules
# this one is needed for the OIDC client
from flask_pyoidc.flask_pyoidc import OIDCAuthentication
# initialize Flask, etc.
@MalphasWats
MalphasWats / flask_ajax.py
Created July 2, 2012 08:15
Making a basic AJAX request with Flask
# Answer to a question on Flask mailing list
# http://librelist.com/browser//flask/2012/6/30/using-ajax-with-flask/
# NOTE: *REALLY* don't do the thing with putting the HTML in a global
# variable like I have, I just wanted to keep everything in one
# file for the sake of completeness of answer.
# It's generally a very bad way to do things :)
#
from flask import (Flask, request, jsonify)
app = Flask(__name__)