我正在尝试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
网站地图我自己做了。
答案 0 :(得分:0)
我刚刚运行了 python manage.py '/sitemap.xml'
并没有出错