From f15ea7323574f6c78926a000db859d278d8d3985 Mon Sep 17 00:00:00 2001 From: mi Date: Thu, 6 Nov 2025 22:13:35 +1000 Subject: [PATCH] :lock: manage secret and port via environment variables --- app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 6541a80..e6d2adc 100644 --- a/app.py +++ b/app.py @@ -1,10 +1,11 @@ +import os from flask import Flask, render_template, abort from comics_data import COMICS app = Flask(__name__) # Configuration -app.config['SECRET_KEY'] = 'your-secret-key-here' # Change this in production +app.config['SECRET_KEY'] = os.environ.get('SECRET_KEY', 'your-secret-key') def get_comic_by_number(number): @@ -65,4 +66,5 @@ def page_not_found(e): if __name__ == '__main__': - app.run(debug=True, port=3000) \ No newline at end of file + port = int(os.environ.get('PORT', 3000)) + app.run(debug=True, port=port) \ No newline at end of file