title: Django: How to ignore tasks with Celery?
body: <p>Without changing the code itself, Is there a way to ignore tasks in Celery?</p>
  <p>For example, when using Django mails, there is a <a href="https://docs.djangoproject.com/en/3.0/topics/email/#dummy-backend" rel="nofollow noreferrer">Dummy Backend</a> setting. This is perfect since it allows me, from a <code>.env</code> file to deactivate mail sending in some environments (like testing, or staging). The code itself that handles mail sending is not changed with <code>if</code> statements or decorators.</p>
  <p>For celery tasks, I know I could do it in code using mocks or decorators, but I'd like to do it in a clean way that is 12factors compliant, like with Django mails. Any idea?</p>
  <h3>EDIT to explain why I want to do this:</h3>
  <p>One of the main motivation behind this, is that it creates coupling between Django web server and Celery tasks.
  For example, when running unit tests, if the broker server (Redis for me) is not running, then if <code>delay()</code> method is called, it freezes forever, because there is no timeout when Celery tries to send a task to Redis.
  From an architecture view, this is very bad. I'd like my unit tests can run properly without the requirement to run a Celery broker!</p>
  <p>Thanks!</p>