Skip to content

Instantly share code, notes, and snippets.

@promediacorp
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save promediacorp/df9cd9d64e619c95f9c5 to your computer and use it in GitHub Desktop.
Save promediacorp/df9cd9d64e619c95f9c5 to your computer and use it in GitHub Desktop.
flask app debug
import logging
from flask import Flask, render_template
import smtplib
app = Flask(__name__)
ADMINS = ['wilensky@gmail.com']
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