Skip to content

Instantly share code, notes, and snippets.

View nixnmtm's full-sized avatar
💭
Happily Coding

Nixon nixnmtm

💭
Happily Coding
  • Nationwide Children's Hospital
  • Westerville, OH, USA
  • X @nixnmtm
View GitHub Profile
@nixnmtm
nixnmtm / rest-server.py
Created April 17, 2018 06:27 — forked from miguelgrinberg/rest-server.py
The code from my article on building RESTful web services with Python and the Flask microframework. See the article here: http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':