Bird
0
0

Identify the error in this Django Celery configuration snippet using Redis as broker: ```python CELERY_BROKER_URL = 'redis://localhost:6379' CELERY_RESULT_BACKEND = 'redis://localhost:6379/0' ```

medium📝 Debug Q6 of 15
Django - Celery and Background Tasks
Identify the error in this Django Celery configuration snippet using Redis as broker: ```python CELERY_BROKER_URL = 'redis://localhost:6379' CELERY_RESULT_BACKEND = 'redis://localhost:6379/0' ```
AMissing Redis database number in CELERY_BROKER_URL
BWrong protocol used; should be http:// instead of redis://
CResult backend cannot use Redis
DPort number 6379 is incorrect for Redis
Step-by-Step Solution
Solution:
  1. Step 1: Check Redis URL format for broker

    Broker URL should specify Redis DB number like /0; missing here.
  2. Step 2: Validate other options

    Protocol redis:// is correct; Redis can be result backend; port 6379 is default.
  3. Final Answer:

    Missing Redis database number in CELERY_BROKER_URL -> Option A
  4. Quick Check:

    Redis URLs need DB number like /0 [OK]
Quick Trick: Always include Redis DB number in broker URL [OK]
Common Mistakes:
MISTAKES
  • Omitting Redis DB number in URLs
  • Using http:// instead of redis://
  • Thinking Redis can't be result backend

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes