Flask-Workshop/10-debugger.py
2020-11-23 20:49:19 +01:00

16 lines
282 B
Python

from flask import Flask, render_template
import random
app = Flask(__name__)
@app.route('/')
def index():
coin = random.random()
if coin >= 0.5:
return "Lucky you!"
else:
raise Exception("Bad luck")
if __name__ == '__main__':
app.run(debug=False)