WMGZON/app.py

31 lines
743 B
Python
Raw Normal View History

from flask import Flask
2023-12-31 16:59:53 +00:00
from os import environ
from controllers.web.endpoints import blueprint
'''
Main entrypoint for Flask application.
Initialises any components that are needed at runtime such as the
Database manager...
'''
2024-01-21 22:06:06 +00:00
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 = "DEFAULTKEY"
2023-12-31 16:59:53 +00:00
else:
app.secret_key = secret_key
2024-01-21 22:06:06 +00:00
# Register a blueprint
app.register_blueprint(blueprint)
app.run(debug=True, host="0.0.0.0")
2024-01-21 22:06:06 +00:00
if __name__ == "__main__":
main()