Spaces:
Running
Running
Update config.py
Browse files
config.py
CHANGED
|
@@ -23,4 +23,24 @@ _BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
| 23 |
STORE_PATH = os.environ.get("STORE_PATH", os.path.join(_BASE_DIR, "data", "progress.json"))
|
| 24 |
|
| 25 |
SUPPORTED_LANGUAGES = ["python", "javascript", "java", "cpp"]
|
| 26 |
-
EXPLANATION_LEVELS = ["Beginner", "Intermediate", "Expert"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
STORE_PATH = os.environ.get("STORE_PATH", os.path.join(_BASE_DIR, "data", "progress.json"))
|
| 24 |
|
| 25 |
SUPPORTED_LANGUAGES = ["python", "javascript", "java", "cpp"]
|
| 26 |
+
EXPLANATION_LEVELS = ["Beginner", "Intermediate", "Expert"]
|
| 27 |
+
|
| 28 |
+
# ---- Judge0 (real execution for JavaScript, C++, and Java; optionally Python too) ----
|
| 29 |
+
# Default: the free public Judge0 CE instance (ce.judge0.com) - no key
|
| 30 |
+
# required, community rate limits apply, fine for a hackathon/demo workload.
|
| 31 |
+
# Set JUDGE0_RAPIDAPI_KEY to switch to the RapidAPI-hosted instance instead
|
| 32 |
+
# (its own free tier, higher limits) - see README for setup steps.
|
| 33 |
+
JUDGE0_RAPIDAPI_KEY = os.environ.get("JUDGE0_RAPIDAPI_KEY", "")
|
| 34 |
+
JUDGE0_BASE_URL = (
|
| 35 |
+
"https://judge0-ce.p.rapidapi.com"
|
| 36 |
+
if JUDGE0_RAPIDAPI_KEY
|
| 37 |
+
else "https://ce.judge0.com"
|
| 38 |
+
)
|
| 39 |
+
JUDGE0_TIMEOUT_SECONDS = float(os.environ.get("JUDGE0_TIMEOUT_SECONDS", "10.0"))
|
| 40 |
+
|
| 41 |
+
# Which engine handles Python specifically:
|
| 42 |
+
# "local" (default) - the existing subprocess sandbox. Fast, free, no
|
| 43 |
+
# network dependency - safest choice for a live demo.
|
| 44 |
+
# "judge0" - routes Python through Judge0 too, for full engine parity with
|
| 45 |
+
# C++/Java. Adds network latency + a dependency on Judge0 uptime.
|
| 46 |
+
PYTHON_EXECUTION_ENGINE = os.environ.get("PYTHON_EXECUTION_ENGINE", "local").strip().lower()
|