Skip to content

Instantly share code, notes, and snippets.

View amirkav's full-sized avatar
👷‍♂️
done is better than perfect

Amir Kavousian amirkav

👷‍♂️
done is better than perfect
View GitHub Profile

Keybase proof

I hereby claim:

  • I am amirkav on github.
  • I am amirkav (https://keybase.io/amirkav) on keybase.
  • I have a public key whose fingerprint is A7ED 3B32 2902 0F7A 1DD8 1704 CDD0 2A6E 01D7 00F4

To claim this, I am signing this object:

@amirkav
amirkav / rest-server.py
Created June 27, 2017 23:38 — 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':