Last active
August 29, 2015 14:02
-
-
Save methane/2fedaf48ed7195ecab6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function, division, absolute_import | |
import flask | |
app = flask.Flask(__name__) | |
@app.route('/') | |
def index(): | |
return u'Hello' | |
@app.after_request | |
def after(obj): | |
print("After:", obj) | |
1 / 0 | |
return obj | |
@app.teardown_appcontext | |
def last(exc): | |
print("Last:", exc) | |
app.run(debug=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import print_function, division, absolute_import | |
import flask | |
app = flask.Flask(__name__) | |
@app.route('/') | |
def index(): | |
return u'Hello' | |
@app.after_request | |
def after(obj): | |
print("After:", obj) | |
1 / 0 | |
return obj | |
@flask.appcontext_tearing_down.connect_via(app) | |
def last(sender, exc): | |
print("Last:", sender, exc) | |
app.run(debug=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment