Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Attribute Error at/ 'str' object has no attribute 'makefile'

I’m learning Django and got this error in my first code itself.

what's wrong in this code

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’

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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")
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading