Add CSRF_TRUSTED_ORIGINS env var support (#9)

This commit is contained in:
Ben Roberts
2026-06-16 01:54:17 +01:00
committed by GitHub
parent 6aab42b03e
commit af845e3490
2 changed files with 3 additions and 0 deletions

View File

@@ -20,3 +20,4 @@ BAMBU_PASSWORD=your_password
# DEBUG=True
# DJANGO_SECRET_KEY=change-me-to-a-random-string
# ALLOWED_HOSTS=localhost,127.0.0.1
# CSRF_TRUSTED_ORIGINS="https://bambu-run.example.com,http://bambu-run.example.com"

View File

@@ -111,6 +111,8 @@ PRINTER_IP = os.environ.get("PRINTER_IP", "")
ACCESS_TOKEN = os.environ.get("ACCESS_TOKEN", "")
PRINTER_SERIAL = os.environ.get("PRINTER_SERIAL", "")
CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS", "").split(",")
# Logging
LOGGING = {
"version": 1,