Skip to content

Instantly share code, notes, and snippets.

@lonnen
Created April 8, 2013 17:49
Show Gist options
  • Save lonnen/5338856 to your computer and use it in GitHub Desktop.
Save lonnen/5338856 to your computer and use it in GitHub Desktop.
Returning a custom response code in Flask without subclassing `werkzeug.exceptions.HTTPException`.
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return ("Failed Dependency", 424, {})
if __name__ == "__main__":
app.run(debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment