django ping 谷歌 http 错误

标签 django ping http-error

我正在尝试 ping Google,但收到 HTTP 错误。为什么?
env/bin/python manage.py ping_google [/sitemap.xml]

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/var/www/wen/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/var/www/wen/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/var/www/wen/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/var/www/wen/env/local/lib/python2.7/site-packages/django/contrib/sitemaps/management/commands/ping_google.py", line 13, in execute
    ping_google(sitemap_url=sitemap_url)
  File "/var/www/wen/env/local/lib/python2.7/site-packages/django/contrib/sitemaps/__init__.py", line 37, in ping_google
    urlopen("%s?%s" % (ping_url, params))
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 406, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 444, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 400: Bad Request

网站 map 我自己做的。

最佳答案

我刚刚跑了python manage.py '/sitemap.xml'我没有错误

关于django ping 谷歌 http 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25564171/

相关文章:

Python ping IPv6主机列表并随时间创建可达和不可达主机的字典

ruby-on-rails - Rails 3 的错误捕获、监控和通知?

python - 从 Mechanize 中的 HTTPError 中恢复

python - DjangoRestFramework上传文件 'CSRF Verification Failed'

python - Django:部署到 ElasticBeanstalk myapp.settings 上导入错误

c - 在 C 程序中使用 ping 命令的主机可达性

php - 在 PHP 中使用 Mysql 时出现错误 500

python - Tornado .httpclient.HTTPError : HTTP 599: Timeout during request

Django 。将变量从 View 传递到模板

django - 使用South和Django显式设置MySQL表存储引擎