rewritten after codex recommendations

This commit is contained in:
2026-07-18 20:27:19 +02:00
parent f9dc885937
commit 399f539b4f
22 changed files with 1448 additions and 996 deletions
+19 -8
View File
@@ -1,16 +1,27 @@
"""Flowers application factory."""
from flask import Flask
from flower_vase import flower_bp
from Config import COOKIE_SECURE, DEBUG, SECRET_KEY
from flower_vase import CredentialStore, flower_bp
def create_app():
def create_app(test_config: dict | None = None) -> Flask:
app = Flask(__name__)
app.config["SECRET_KEY"] = 'adhf adsh 8347y92347rupqo;wjf cowuyergc9b24387ryx1 -923pqr pqwejf qy7i34'
app.config.from_mapping(
SECRET_KEY=SECRET_KEY,
SESSION_COOKIE_HTTPONLY=True,
SESSION_COOKIE_SAMESITE="Lax",
SESSION_COOKIE_SECURE=COOKIE_SECURE,
MAX_CONTENT_LENGTH=64 * 1024,
)
if test_config:
app.config.update(test_config)
app.extensions["credential_store"] = CredentialStore()
app.register_blueprint(flower_bp)
return app
if __name__ == '__main__':
my_app = create_app()
# if needed - initialize data
my_app.run(debug=True, host='127.0.0.1', port=5012)
if __name__ == "__main__":
create_app().run(debug=DEBUG, host="127.0.0.1", port=5012)