Update app.py
Browse files
app.py
CHANGED
|
@@ -34,7 +34,17 @@ if not OPENAI_API_KEY:
|
|
| 34 |
app.logger.warning("OPENAI_API_KEY is not set in the environment")
|
| 35 |
|
| 36 |
# βββ 5) Database config βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 37 |
-
app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
|
| 39 |
app.secret_key = os.getenv("SECRET_KEY", "your_secret_key_here")
|
| 40 |
|
|
|
|
| 34 |
app.logger.warning("OPENAI_API_KEY is not set in the environment")
|
| 35 |
|
| 36 |
# βββ 5) Database config βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 37 |
+
app = Flask(
|
| 38 |
+
__name__,
|
| 39 |
+
instance_path="/mnt/data",
|
| 40 |
+
instance_relative_config=True
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
# 2) ensure it actually exists (should, but no harm)
|
| 44 |
+
os.makedirs(app.instance_path, exist_ok=True)
|
| 45 |
+
|
| 46 |
+
# 3) configure your DB to live there as well
|
| 47 |
+
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:////mnt/data/jobs.db"
|
| 48 |
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
|
| 49 |
app.secret_key = os.getenv("SECRET_KEY", "your_secret_key_here")
|
| 50 |
|