I'm learning Django and got this error in my first code itself.
I was trying for just Hello world type of program using Django, everything was perfect but got this error 'str' object has no attribute 'makefile'
CodePudding user response:
You are importing HTTPResponse
from somewhere (http.client?) (I guess on line 1 of your script)
django.http
has only HttpResponse
. Try:
def home(request):
return HttpResponse("Hello world")