siddhm11 commited on
Commit
5e4eb35
Β·
1 Parent(s): d5a6f3e

Use python-dotenv for secrets management

Browse files

config.py now loads .env via load_dotenv() at import time.
All secrets default to empty strings in code.
Locally: .env provides credentials (in .gitignore, never pushed).
HF Spaces: set via Secrets panel (env vars).

Files changed (3) hide show
  1. .gitattributes +1 -0
  2. .gitignore +0 -0
  3. app/config.py +4 -1
.gitattributes ADDED
@@ -0,0 +1 @@
 
 
1
+ *.png filter=lfs diff=lfs merge=lfs -text
.gitignore CHANGED
Binary files a/.gitignore and b/.gitignore differ
 
app/config.py CHANGED
@@ -1,8 +1,11 @@
1
  """
2
  Centralised settings for the arxiv recommender app.
3
- All credentials live here; override with environment variables in production.
4
  """
5
  import os
 
 
 
6
 
7
  # ── Qdrant (BGE-M3 dense, 1 024-dim) ─────────────────────────────────────────
8
  QDRANT_URL = os.getenv("QDRANT_URL", "")
 
1
  """
2
  Centralised settings for the arxiv recommender app.
3
+ All credentials live in .env locally; override with env vars in production.
4
  """
5
  import os
6
+ from dotenv import load_dotenv
7
+
8
+ load_dotenv() # reads .env file if present (won't override existing env vars)
9
 
10
  # ── Qdrant (BGE-M3 dense, 1 024-dim) ─────────────────────────────────────────
11
  QDRANT_URL = os.getenv("QDRANT_URL", "")