HttpResponse error with Google Webmater Tools

匆匆过客 提交于 2019-12-14 02:16:03

问题


I'm trying to use Google Webmaster Tools following this guide

I implemented my url as it says

(r'^googlece9fb428b0c84a39\.html$', lambda r: HttpResponse("google-site-verification: googlece9fb428b0c84a39.html", mimetype="text/plain")),

But I'm getting the following error when acessing the url:

NameError at /googlece9fb428b0c84a39.html
global name 'HttpResponse' is not defined

回答1:


from django.http import HttpResponse




回答2:


just need to import HttpResponse from django.http



来源:https://stackoverflow.com/questions/21975206/httpresponse-error-with-google-webmater-tools

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!