title: Python/Django requests JSONDecodeError: Expecting value: line 1 column 1 (char 0)
body: <p>I am trying make <em>Microservice warehouse / store</em>. Everything is ok, but when I want to connect celery to my project, I am getting error
  <code>Expecting value: line 1 column 1 (char 0) when trying to start celery</code></p>
  <pre><code>@shared_task
  def shop_sync():
      url = 'http://warehouse:8001/authors/'
      response_author = requests.get(url=url).json()
      while 1:
          for counter, data in enumerate(response_author['results']):
              Author.objects.get_or_create(
                  id=data['id'],
                  defaults={
                      'id': data['id'],
                      'first_name': data['first_name'],
                      'last_name': data['last_name']
                  }
              )
  
          if response_author['next']:
              response_author = requests.get(response_author['next']).json()
          else:
              break
  
      url = 'http://warehouse:8001/genres/'
      response_genre = requests.get(url).json()
      while 1:
          for counter, data in enumerate(response_genre['results']):
              Genre.objects.get_or_create(
                  id=data['id'],
                  defaults={
                      'id': data['id'],
                      'name': data['name']
                  }
              )
  
          if response_genre['next']:
              response_genre = requests.get(
                  response_genre['next']
              ).json()
          else:
              break
      url = 'http://warehouse:8001/books/'
      response = requests.get(url).json()
      while 1:
          for counter, data in enumerate(response['results']):
              book, created = Book.objects.get_or_create(
                  id=data['id'],
                  defaults={
                      'id': data['id'],
                      &quot;title&quot;: data['title'],
                      &quot;description&quot;: data['description'],
                      &quot;image&quot;: data['image'],
                      &quot;language&quot;: data['language'],
                      &quot;status&quot;: data['status'],
                      &quot;price&quot;: data['price'],
                      &quot;isbn&quot;: data['isbn'],
                      &quot;pages&quot;: data['pages'],
                      &quot;created&quot;: data['created'],
                      &quot;available&quot;: data['available'],
                      &quot;quantity&quot;: data['quantity'],
                      &quot;genre&quot;: Genre.objects.get(id=data['genre'])
                  }
              )
  
              if not created:
                  book.title = data['title']
                  book.description = data['description']
                  book.image = data['image']
                  book.language = data['language']
                  book.status = data['status']
                  book.price = data['price']
                  book.isbn = data['isbn']
                  book.pages = data['pages']
                  book.created = data['created']
                  book.available = data['available']
                  book.quantity = data['quantity']
                  book.genre = Genre.objects.get(id=data['genre'])
                  book.save()
  
              for i in data['author']:
                  author = Author.objects.get(id=i)
                  book.author.add(author)
  
          if response['next']:
              response = requests.get(response['next']).json()
          else:
              break
      print('Sync is done')
  </code></pre>
  <p>Exception:</p>
  <pre><code>Traceback (most recent call last):
      File &quot;/usr/local/lib/python3.9/site-packages/celery/app/trace.py&quot;, line 450, in trace_task
      R = retval = fun(*args, **kwargs)
      File &quot;/usr/local/lib/python3.9/site-packages/celery/app/trace.py&quot;, line 731, in __protected_call__
      return self.run(*args, **kwargs)
      File &quot;/code/shop/tasks.py&quot;, line 105, in shop_sync
      response = requests.get(url=url).json()
      File &quot;/usr/local/lib/python3.9/site-packages/requests/models.py&quot;, line 910, in json
      return complexjson.loads(self.text, **kwargs)
      File &quot;/usr/local/lib/python3.9/json/__init__.py&quot;, line 346, in loads
      return _default_decoder.decode(s)
      File &quot;/usr/local/lib/python3.9/json/decoder.py&quot;, line 337, in decode
      obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File &quot;/usr/local/lib/python3.9/json/decoder.py&quot;, line 355, in raw_decode
      raise JSONDecodeError(&quot;Expecting value&quot;, s, err.value) from None
      json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  </code></pre>