Update main.py
Browse files
main.py
CHANGED
|
@@ -2,8 +2,19 @@ from flask import Flask, render_template, request, redirect, url_for, session
|
|
| 2 |
import random
|
| 3 |
import os
|
| 4 |
import time
|
|
|
|
| 5 |
app = Flask(__name__)
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
def generate_question(low, high, operation):
|
|
|
|
| 2 |
import random
|
| 3 |
import os
|
| 4 |
import time
|
| 5 |
+
|
| 6 |
app = Flask(__name__)
|
| 7 |
+
|
| 8 |
+
# 1. Update the secret key to be more secure
|
| 9 |
+
app.secret_key = os.environ.get("SECRET_KEY", "math_quiz_default_key_123")
|
| 10 |
+
|
| 11 |
+
# 2. Add this block to fix the "Resetting to Defaults" issue
|
| 12 |
+
app.config.update(
|
| 13 |
+
SESSION_COOKIE_SAMESITE='None',
|
| 14 |
+
SESSION_COOKIE_SECURE=True
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
# ... the rest of your functions (generate_question, etc.) follow below
|
| 18 |
|
| 19 |
|
| 20 |
def generate_question(low, high, operation):
|