45 lines
1.3 KiB
Python
45 lines
1.3 KiB
Python
import os
|
|
|
|
c = get_config()
|
|
|
|
# Database configuration - use the same PostgreSQL as JupyterHub
|
|
p_user = os.environ.get("POSTGRES_USER", "")
|
|
p_pass = os.environ.get("POSTGRES_PASSWORD", "")
|
|
p_host = os.environ.get("POSTGRES_HOST", "postgres")
|
|
p_db = os.environ.get("POSTGRES_DB", "jupyterhub")
|
|
|
|
# NBgrader database URL
|
|
c.CourseDirectory.db_url = f"postgresql://{p_user}:{p_pass}@{p_host}:5432/{p_db}"
|
|
|
|
# Course configuration
|
|
course_id = os.environ.get("NBGRADER_COURSE_ID", "default_course")
|
|
c.CourseDirectory.course_id = course_id
|
|
c.CourseDirectory.root = "/srv/nbgrader"
|
|
|
|
# Exchange directory configuration
|
|
exchange_dir = os.environ.get("NBGRADER_EXCHANGE_DIRECTORY", "/srv/nbgrader/exchange")
|
|
c.Exchange.root = exchange_dir
|
|
c.CourseDirectory.course_id = course_id
|
|
|
|
# Authentication
|
|
c.FormgradeApp.authenticator_plugin_class = "nbgrader.auth.JupyterHubAuthPlugin"
|
|
|
|
# Logging
|
|
c.Application.log_level = "INFO"
|
|
|
|
# Formgrader settings
|
|
c.FormgradeApp.ip = "0.0.0.0"
|
|
c.FormgradeApp.port = 9999
|
|
c.FormgradeApp.base_url = "/jupyter/services/nbgrader-formgrader/"
|
|
|
|
# Enable tornado debug mode for development
|
|
c.FormgradeApp.tornado_settings = {"debug": True}
|
|
|
|
# Assignment settings
|
|
c.AssignmentListApp.assignment_dir = "/home/jovyan/assignments"
|
|
c.AssignmentListApp.exchange_directory = exchange_dir
|
|
|
|
# Grader settings
|
|
c.AutogradeApp.force = True
|
|
c.GenerateAssignmentApp.force = True
|