Skip to content
Snippets Groups Projects
Commit a7a2d939 authored by Felix Chadwick-Smith's avatar Felix Chadwick-Smith
Browse files

imported os

parent 7bff2f0b
Branches
No related tags found
1 merge request!13Renamed
import os
import secrets
from flask import Flask, render_template, request, redirect, url_for, send_from_directory, abort
from flask_sqlalchemy import SQLAlchemy
......@@ -7,6 +8,7 @@ app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 0
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///site.db'
app.config['SECRET_KEY'] = secrets.token_hex(16)
db = SQLAlchemy(app)
class Project(db.Model):
......@@ -84,6 +86,5 @@ def download_assessment(filename):
print(f"Error serving assessment file: {str(e)}")
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)))
app.run(debug=True, port=int(os.environ.get('PORT', 8080)))
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment