5👍
✅
There is 2 definitions:
HttpResponse in django
HTTPResponse in python.
You are using the python class with the django init argument style: HTTPResponse("hello Nikhil").
So make sure you use the right import statement AND pay attention to the HTTP and Http:
from django.http import HttpResponse
Just for information
- Python Definition:
class HTTPResponse(io.BufferedIOBase):
def __init__(self, sock, debuglevel=0, method=None, url=None):
- Django Definition:
class HttpResponse(HttpResponseBase):
def __init__(self, content=b'', *args, **kwargs):
Source:stackexchange.com