title: Django why is this code blocking http requests
body: <p>Here is the module:</p>
  <pre><code>import threading
  import time
  import pandas as pd
  
  from binance.client import Client
  import json
  
  from api_create_alert.models import Alerts
  from service_get_data.get_api_secret import get_secret
  
  alerts = Alerts.objects.all().values()
  df = pd.DataFrame(alerts)
  
  data = get_secret()
  data = json.loads(data)
  client = Client(data['BINANCE_PUBLIC_API'], data['BINANCE_SECRET_API'])
  
  
  
  def price_watch():
      interval = 10
  
      while True:
          coins = client.get_all_tickers()
  
          for coin in coins:
              symbol = coin['symbol']
              price = float(coin['price'])
              rows = df[((df.symbol == symbol) &amp; (df.direction == 'ABOVE') &amp; (price &gt; df.price)) | ((df.symbol == symbol) &amp; (df.direction == 'BELOW') &amp; (price &lt; df.price))]
  
              if len(rows) &gt; 0:
                  print(rows)
  
          time.sleep(interval)
  
  
  thread = threading.Thread(target=price_watch)
  thread.start()
  </code></pre>
  <p>Importing it from <code>apps.py</code>:</p>
  <pre><code>def ready(self):
      if os.environ.get(&quot;RUN_MAIN&quot;) == &quot;true&quot;:
          import service_price_watch.price_watch
  </code></pre>
  <p>So it's a loop that runs every 10 seconds, each time the loop starts running the Django app is blocked no response is received until the loop is done, now why is that happening when I'm using the <code>threading</code> module, isn't the purpose of <code>threading</code> module is to make Async operations?</p>