【问题标题】:HttpResponse error with Google Webmater ToolsGoogle 网站管理员工具出现 HttpResponse 错误
【发布时间】:2014-03-25 08:59:18
【问题描述】:

我正在尝试按照guide 使用 Google 网站管理员工具

我按照上面的说明实现了我的网址

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

但访问网址时出现以下错误:

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

【问题讨论】:

  • 你是否从 django.http 导入了 HttpResponse?
  • 谢谢!只需要导入它

标签: django google-search-console


【解决方案1】:

from django.http import HttpResponse

【讨论】:

    【解决方案2】:

    只需要从 django.http 导入 HttpResponse

    【讨论】:

      猜你喜欢
      • 2013-11-16
      • 2017-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-12
      • 2011-07-21
      • 2014-10-03
      相关资源
      最近更新 更多