Skip to content

Make API keys optional with defaults in settings - #56

Closed
railway-app[bot] wants to merge 1 commit into
mainfrom
sandbox/6eca058b-c7ed-430d-9288--rq8c
Closed

railway-app[bot] wants to merge 1 commit into
mainfrom
sandbox/6eca058b-c7ed-430d-9288--rq8c

Conversation

@railway-app

@railway-app railway-app Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Problem

The Celery worker service crashed on startup because config/settings.py required all API keys (GOOGLE_AI_API_KEY, GROQ_API_KEY, ANTHROPIC_API_KEY, COHERE_API_KEY, etc.) to be defined without defaults. This is problematic because:

  1. The worker loads Django settings but doesn't use all API keys
  2. Different services may need different API keys
  3. Missing optional keys should not crash the app

Solution

Changed all optional API keys and service-specific variables to use default="" (empty string) instead of requiring them:

  • GOOGLE_AI_API_KEY
  • GROQ_API_KEY
  • ANTHROPIC_API_KEY
  • COHERE_API_KEY
  • All Stripe configuration
  • Email configuration
  • Google OAuth

This allows both the web service and worker to start regardless of which keys are configured, while still supporting these features when the keys are provided.

Changes

  • Updated backend/config/settings.py to add default="" to all optional API keys and service-specific variables
  • Kept SECRET_KEY required (as it should be)
  • Kept DATABASE_URL required (as it should be)
  • Made Supabase storage keys optional (only required when USE_SUPABASE_STORAGE is True)

## Problem
The Celery worker service crashed on startup because `config/settings.py` required all API keys (GOOGLE_AI_API_KEY, GROQ_API_KEY, ANTHROPIC_API_KEY, COHERE_API_KEY, etc.) to be defined without defaults. This is problematic because:
1. The worker loads Django settings but doesn't use all API keys
2. Different services may need different API keys
3. Missing optional keys should not crash the app

## Solution
Changed all optional API keys and service-specific variables to use `default=""` (empty string) instead of requiring them:
- GOOGLE_AI_API_KEY
- GROQ_API_KEY
- ANTHROPIC_API_KEY
- COHERE_API_KEY
- All Stripe configuration
- Email configuration
- Google OAuth

This allows both the web service and worker to start regardless of which keys are configured, while still supporting these features when the keys are provided.

## Changes
- Updated `backend/config/settings.py` to add `default=""` to all optional API keys and service-specific variables
- Kept `SECRET_KEY` required (as it should be)
- Kept `DATABASE_URL` required (as it should be)
- Made Supabase storage keys optional (only required when USE_SUPABASE_STORAGE is True)
@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
draftly Ready Ready Preview Sep 7, 2026 3:35am UTC

This branch was successfully deployed

1 active and 1 inactive deployments
Preview 5e93c1be Deployed Sep 7, 2026 by vercel[bot]
terrific-spontaneity / production 5e93c1be Deployed Sep 7, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant