title: Djcelery : How to save celery task status into database
body: <p>My celery task runs well<br>
  But I found my <code>djcelery_taskstate</code> table has nothing   :<br>
  <a href="https://i.stack.imgur.com/kkP9s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kkP9s.png" alt="enter image description here"></a></p>
  
  <p>How can it save data into it??  </p>
  
  <p>Here is my setting :  </p>
  
  <p><code>settings.py</code></p>
  
  <pre><code>BROKER_URL = 'redis://localhost:6379'
  CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler'  
  CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend'
  CELERY_TIMEZONE = 'Asia/Taipei'
  </code></pre>
  
  <p><code>celery.py</code> </p>
  
  <pre><code>from __future__ import absolute_import
  import os
  from celery import Celery
  
  os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
  from django.conf import settings  # noqa
  app = Celery('myproject')
  
  app.config_from_object('django.conf:settings')
  app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
  app.conf.update(
      CELERY_RESULT_BACKEND='djcelery.backends.database:DatabaseBackend',
      CELERY_TIMEZONE = 'Asia/Taipei'
  )
  </code></pre>
  
  <p><code>tasks.py</code>  </p>
  
  <pre><code>from __future__ import absolute_import
  from celery.task.schedules import crontab
  from celery.decorators import periodic_task
  from celery import task
  from datetime import timedelta
  from myapp.deal import check_data
  
  
  @periodic_task(run_every=timedelta(seconds=30),name="collect-rawdata",ignore_result=True)
  def rawdata():
      return check_data()
  </code></pre>
  
  <p>Here is my command to run celery  : </p>
  
  <p>one  terminal run:</p>
  
  <pre><code>celery -A wiarea worker -l info
  </code></pre>
  
  <p>another run: </p>
  
  <pre><code>celery -A wiarea beat -l info 
  </code></pre>