from christmas import app app.run(debug=True)
def purpose(): return render_template('purpose.html') @app.route('/contact', methods=['GET', 'POST']) def contact(): form = ContactForm() if request.method == 'POST': if form.validate() == False: flash('All fields are required.') return render_template('contact.html', form=form) else: return 'Form posted.' elif request.method == 'GET': return render_template('contact.html', form=form) @app.route('/testdb') def testdb(): if db.session.query("1").from_statement("SELECT 1").all(): return 'It works.' else: return 'Something is broken.' if __name__ == "__main__": port = int(os.environ.get("PORT", 5000)) app.run(host='0.0.0.0', port=port)