Content-Type header is “text/html”, not “application/json”

Time:2021-7-25

report errors
DRF operation error valueerror: content type header is “text / HTML”, not “application / JSON”

----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users293\Desktop\Coder\Python\Django\twitter\newsfeeds\api\tests.py", line 41, in test_list
    print(response.json())
  File "C:\Users293\AppData\Local\Programs\Python\Python39\lib\site-packages\django\test\client.py", line 662, in _parse_json
    raise ValueError(
ValueError: Content-Type header is "text/html", not "application/json"

----------------------------------------------------------------------
Ran 1 test in 0.362s

FAILED (errors=1)
Destroying test database for alias 'default'...

Error reporting causes and solutions:
gourls.pyAdd routing configuration to file