WMGZON/app.py

27 lines
723 B
Python
Raw Normal View History

from flask import Flask, render_template
2023-12-31 16:59:53 +00:00
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__)
2023-12-31 16:59:53 +00:00
# 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)
if __name__ == "__main__":
main()