From 7bff2f0b0d1ee256e412fe103cb4a09cb7a05c58 Mon Sep 17 00:00:00 2001 From: Felix Chadwick-Smith <chadwick-smithff@cardiff.ac.uk> Date: Wed, 10 Jan 2024 17:20:16 +0000 Subject: [PATCH] changed it again --- app.py | 3 +++ wsgi.py | 10 ++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app.py b/app.py index 9ce2d31..3c57807 100644 --- a/app.py +++ b/app.py @@ -13,6 +13,7 @@ class Project(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(100), nullable=False) description = db.Column(db.Text, nullable=False) + @app.route('/') def home(): try: @@ -84,3 +85,5 @@ def download_assessment(filename): app.logger.exception(f"Error serving assessment file: {str(e)}") abort(500) +if __name__ == '__main__': + app.run(debug=True, port=int(os.environ.get('PORT', 8080))) diff --git a/wsgi.py b/wsgi.py index 14ea89c..5db2a34 100644 --- a/wsgi.py +++ b/wsgi.py @@ -1,6 +1,4 @@ import os -import sys -import logging from app import app as application from markupsafe import Markup @@ -8,9 +6,5 @@ sys.modules['flask'].Markup = Markup logging.basicConfig(stream=sys.stderr) -try: - if __name__ == '__main__': - application.run(host='0.0.0.0', port=int(os.environ.get('PORT', 8080))) -except Exception as e: - print(f"Exception during startup: {str(e)}") - sys.exit(1) +if __name__ == '__main__': + application.run(host='0.0.0.0', port=int(os.environ.get('PORT', 8080))) -- GitLab