from flask import Flask from os import environ from web import blueprint ''' Main entrypoint for Flask application. Initialises any components that are needed at runtime such as the Database manager... ''' def main(): app = Flask(__name__) # Set app secret key to sign session cookies secret_key = environ.get("APPSECRET") if secret_key == None: # NO Secret Key set! print("No app secret set, please set one before deploying in production") app.secret_key = "DEFUALTKEY" else: app.secret_key = secret_key # Register a blueprint app.register_blueprint(blueprint) app.run(debug=True, host="0.0.0.0") if __name__ == "__main__": main()