title: Django: Where to place an infinite loop
body: <p>I am currently working on a project where I'd need to integrate a django application with mastodon, a federated twitter-like service.</p>
  
  <p>In order to interact with Mastodon, I use Mastodon.py package: <a href="https://mastodonpy.readthedocs.io/en/stable/#" rel="nofollow noreferrer">https://mastodonpy.readthedocs.io/en/stable/#</a></p>
  
  <p>I would need to monitor events occurring to a specific mastodon account, a bot account managed by the django application, using the streaming capabilities provided by the package: <a href="https://mastodonpy.readthedocs.io/en/stable/#streaming" rel="nofollow noreferrer">https://mastodonpy.readthedocs.io/en/stable/#streaming</a></p>
  
  <p>So I would need to call one of these stream methods in an infinite loop. But I can't figure out where I should place it in django. Is there a main loop somewhere where I could insert it?</p>