Skip to content

Instantly share code, notes, and snippets.

View patilanup246's full-sized avatar
:octocat:
#code💻 -#eaт🍲-#ѕleep😴;

Anup Patil patilanup246

:octocat:
#code💻 -#eaт🍲-#ѕleep😴;
View GitHub Profile
@patilanup246
patilanup246 / rest-server.py
Created October 15, 2019 10:56 — 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_httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':