flask: No response and No exception traceback when render_template failed and DEBUG=True
Here is the code:
app.py
from flask import Flask, render_template
app = Flask(__name__)
app.config['DEBUG'] = True
@app.route('/')
def index():
return render_template('unknown')
if __name__ == '__main__':
from werkzeug.serving import run_simple
run_simple('127.0.0.1', 5000, app)
Run it by
python app.py
or
export FLASK_APP=app.py
flask run
then visit http://127.0.0.1:5000 will see ERR_EMPTY_RESPONSE in browser and nothing in console.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 22 (12 by maintainers)
I found the
jinja2.exceptions.TemplateNotFoundexception was catch by wrong placeand in python3.5