Skip to content

Commit 819edeb

Browse files
committed
feat(config): add Week 4 ML artifact and scoring settings
1 parent f6ab4e8 commit 819edeb

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

policylens/config/settings.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
"""
33
Django settings for PolicyLens.
44
5-
Environment is the source of truth.
6-
- Local dev uses .env
7-
- Docker Compose supplies env values
8-
- CI sets env values explicitly
5+
Week 4 adds ML artefact directory configuration.
96
"""
107

118
from __future__ import annotations
@@ -21,6 +18,9 @@
2118
DJANGO_SECRET_KEY=(str, ""),
2219
DJANGO_ALLOWED_HOSTS=(str, "localhost,127.0.0.1"),
2320
DATABASE_URL=(str, ""),
21+
ML_ACTIVE_MODEL_VERSION=(str, "v1_2026_01_13"),
22+
ML_SCORE_THRESHOLD=(float, 0.6),
23+
ML_ARTIFACT_DIR=(str, ""), # Optional override
2424
)
2525

2626
SECRET_KEY = env("DJANGO_SECRET_KEY")
@@ -38,9 +38,7 @@
3838
"django.contrib.sessions",
3939
"django.contrib.messages",
4040
"django.contrib.staticfiles",
41-
# Third-party
4241
"rest_framework",
43-
# Local apps
4442
"policylens.apps.core",
4543
"policylens.apps.claims",
4644
]
@@ -101,11 +99,17 @@
10199

102100
REST_FRAMEWORK = {
103101
"DEFAULT_AUTHENTICATION_CLASSES": [
104-
"rest_framework.authentication.BasicAuthentication",
105102
"rest_framework.authentication.SessionAuthentication",
103+
"rest_framework.authentication.BasicAuthentication",
106104
],
107-
# Week 2: core workflow API is authenticated by default.
108105
"DEFAULT_PERMISSION_CLASSES": [
109106
"rest_framework.permissions.IsAuthenticated",
110107
],
111108
}
109+
110+
# ML configuration
111+
ML_ACTIVE_MODEL_VERSION = env("ML_ACTIVE_MODEL_VERSION")
112+
ML_SCORE_THRESHOLD = float(env("ML_SCORE_THRESHOLD"))
113+
114+
_ml_dir = env("ML_ARTIFACT_DIR")
115+
ML_ARTIFACT_DIR = _ml_dir if _ml_dir else str(BASE_DIR.parent / "artifacts" / "ml")

0 commit comments

Comments
 (0)