Skip to content

LO-068 [Easy]: Add Django Settings Validation on Startup #405

Description

@Kuldeeep18

Description

If LeadOrbit is deployed without configuring essential environment variables (e.g. missing GEMINI_API_KEY, GOOGLE_CLIENT_ID or database host credentials), the server starts but crashes dynamically when executing features. We need validation checks on startup.

User & Contributor Value

  • Contributors: Django settings loading lifecycle, handling early exceptions, and environment testing.
  • Users: Prevents deploying misconfigured applications to production.

Code Locations

  • backend/backend/wsgi.py
  • backend/backend/asgi.py

Implementation Guide

  1. In wsgi.py and asgi.py (after django setup), check that crucial settings like GEMINI_API_KEY are not empty.
  2. If missing, write a clear, bold warning message to stdout detailing which environment variables are missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersgssoc:approvedGSSoC 2026 approved base points (+50 pts)level:beginnerDifficulty: Beginner friendly (+20 pts)type:refactorType: Refactor (+10 pts)type:securityType: Security (+20 pts)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions