title: Problem running Celery in ubuntu 18.04 with Supervisor and Django
body: <p>I've set up <code>Supervisor</code> to run some <code>Celery</code> scheduled tasks, but this tasks are never executed. I don't know if I have a bad configuration or if I am missing something to configure. According to my supervisor status all is ok: <code>sudo supervisorctl status my_app -&gt; my_app RUNNING pid 16757, uptime 0:00:04</code></p>
  <h2>What i have</h2>
  <h3>Celery app configuration</h3>
  <pre class="lang-py prettyprint-override"><code>from __future__ import absolute_import, unicode_literals
  import os
  from celery import Celery
  
  os.environ.setdefault(&quot;DJANGO_SETTINGS_MODULE&quot;, &quot;config.settings.local&quot;)
  
  app = Celery(&quot;myproject&quot;)
  
  app.config_from_object(&quot;django.conf:settings&quot;, namespace=&quot;CELERY&quot;)
  
  app.autodiscover_tasks()
  
  app.conf.beat_schedule = {
      &quot;add-two-numbers&quot;: {&quot;task&quot;: &quot;myproject.myapp.tasks.add&quot;, &quot;schedule&quot;: 30.0}
  }
  </code></pre>
  <h3>Supervisor configuration</h3>
  <pre class="lang-sh prettyprint-override"><code>[program:my_app_celery]
  user=root
  directory=/var/www/my_django_app/
  command=/var/www/my_django_app/venv/bin/celery -A config beat -l info
  
  autostart=true
  autorestart=true
  
  stdout_logfile=/var/log/my_project/celery.log
  stderr_logfile=/var/log/my_project/celery.err.log
  </code></pre>
  <h3>Supervisor celery log</h3>
  <pre><code>[2020-07-24 21:40:21,168: INFO/MainProcess] Scheduler: Sending due task add-two-numbers (my_project.my_app.tasks.add)
  </code></pre>
  <h3>celery -A config beat -l info</h3>
  <pre><code>LocalTime -&gt; 2020-07-24 23:06:50
  Configuration -&gt;
      . broker -&gt; redis://localhost:6379//
      . loader -&gt; celery.loaders.app.AppLoader
      . scheduler -&gt; celery.beat.PersistentScheduler
      . db -&gt; celerybeat-schedule
      . logfile -&gt; [stderr]@%INFO
      . maxinterval -&gt; 5.00 minutes (300s)
  [2020-07-24 23:06:50,796: INFO/MainProcess] beat: Starting...
  [2020-07-24 23:06:50,839: INFO/MainProcess] Scheduler: Sending due task add-two-numbers (my_project.my_app.tasks.add)
  </code></pre>
  <h3>Celery task</h3>
  <pre class="lang-py prettyprint-override"><code># Some Django app task
  from __future__ import absolute_import, unicode_literals
  from celery import shared_task
  
  @shared_task
  def add(x, y):
      return x + y
  </code></pre>
  <h3>Django celery setting</h3>
  <pre class="lang-py prettyprint-override"><code>CELERY_BROKER_URL='redis://localhost:6379'
  CELERY_RESULT_BACKEND = CELERY_BROKER_URL
  CELERY_ACCEPT_CONTENT = [&quot;json&quot;]
  CELERY_TASK_SERIALIZER = &quot;json&quot;
  CELERY_RESULT_SERIALIZER = &quot;json&quot;
  CELERY_TASK_TIME_LIMIT = 5 * 60
  CELERY_TASK_SOFT_TIME_LIMIT = 60
  </code></pre>
  <h3>Environment</h3>
  <pre><code>Ubuntu 18.04
  redis-server v=4.0.9
  celery==4.4.6
  django==3.0.8
  python 3.8
  </code></pre>