title: using asyncio to do periodic task in django
body: <p>Do you think it is possible to use asyncio to run a task every n seconds in django, so that the main process wouldn't be blocked?</p>
  
  <p>Something for example that would print every 5 min in console, like:</p>
  
  <pre><code>    import asyncio
      from random import randint
  
      async def do_stuff(something, howmany):   
          for i in range(howmany):
              print('We are doing  {}'.format(something))
              await asyncio.sleep(randint(0, 5))
  
      if __name__ == '__main__':
          loop = asyncio.get_event_loop()
          work = [
              asyncio.ensure_future(do_stuff('something', 5)),
  
          ]
          loop.run_until_complete(asyncio.gather(*work))
  </code></pre>
  
  <p>It seems that django will stop working while the loop is running. Even if this can be made to work in development, how would it behave when the site goes live on something like apache or gunicorn?</p>