title: How to periodically schedule a task django celery
body: <pre><code># In tasks.py file
  from __future__ import absolute_import
  
  from celery import shared_task
  
  @shared_task
  def randadd(x):
      y = randint(0,9)
      return x + y
  
  # In views.py 
      context = {
          'add': tasks.randadd(5)
      }
  def home(request):
      global context
      return render(request, "home.html", context)
  
  # In home.html
  &lt;h1&gt;{{ add }}&lt;/h1&gt;
  </code></pre>
  
  <p>In home.html I see the result of 5 + (a random int). How would I recalculate the result for add so that its value is updated every 30 minutes?</p>
  
  <p>I was able to find this source: <a href="http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html" rel="nofollow">http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html</a>, but I am still confused on how to use it.</p>