Last active
August 29, 2015 14:20
-
-
Save promediacorp/df9cd9d64e619c95f9c5 to your computer and use it in GitHub Desktop.
flask app debug
This file contains hidden or 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
import logging | |
from flask import Flask, render_template | |
import smtplib | |
app = Flask(__name__) | |
ADMINS = ['[email protected]'] | |
app.config['LOG_FILE'] = 'application.log' | |
if not app.debug: | |
import logging | |
from logging import FileHandler | |
file_handler = FileHandler(app.config['LOG_FILE']) | |
file_handler.setLevel(logging.INFO) | |
app.logger.addHandler(file_handler) | |
@app.route("/about") | |
def about(): | |
breadcrumbs = [ | |
{ | |
'href': '/', | |
'text': 'Home' | |
}, | |
{ | |
'href': '/about', | |
'text': 'About' | |
} | |
] | |
##CREATE AN ERROR | |
X = "A" + 1 | |
return render_template('about.html', breadcrumbs=breadcrumbs) | |
if __name__ == "__main__": | |
app.run('0.0.0.0', port=8080, debug=False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment