django-disqus icon indicating copy to clipboard operation
django-disqus copied to clipboard

disqus_export causes HTTP Error 400: BAD REQUEST

Open anikievev opened this issue 11 years ago • 1 comments

I try to run disqus_export but it causes HTTP Error 400: BAD REQUEST. Perhaps it relates to Oauth authorization. Does django-disqus support Oauth ?

This is call stack: Exporting 165 comment(s) {"message":"Key could not be converted to UserKey object","code":"input-invalid","succeeded":false} Traceback (most recent call last): File "manage.py", line 14, in execute_manager(settings) File "/usr/lib/python2.6/site-packages/django/core/management/init.py", line 459, in execute_manager utility.execute() File "/usr/lib/python2.6/site-packages/django/core/management/init.py", line 382, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv self.execute(_args, *_options.dict) File "/usr/lib/python2.6/site-packages/django/core/management/base.py", line 232, in execute output = self.handle(_args, *_options) File "/usr/lib/python2.6/site-packages/disqus/management/commands/disqus_export.py", line 80, in handle forum_list = client.get_forum_list(user_api_key=settings.DISQUS_API_KEY) File "/usr/lib/python2.6/site-packages/disqus/api.py", line 53, in call_method return self.call(attr, *_kwargs) File "/usr/lib/python2.6/site-packages/disqus/api.py", line 79, in call response = urllib2.urlopen(request) File "/usr/lib64/python2.6/urllib2.py", line 126, in urlopen return _opener.open(url, data, timeout) File "/usr/lib64/python2.6/urllib2.py", line 397, in open response = meth(req, response) File "/usr/lib64/python2.6/urllib2.py", line 510, in http_response 'http', request, response, code, msg, hdrs) File "/usr/lib64/python2.6/urllib2.py", line 435, in error return self._call_chain(_args) File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain result = func(*args) File "/usr/lib64/python2.6/urllib2.py", line 518, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 400: BAD REQUEST

anikievev avatar Sep 24 '13 09:09 anikievev

I have the same problem playing with the client in the shell.

@arthurk:

In [10]: client.get_forum_list(user_api_key=settings.DISQUS_API_KEY)
http://disqus.com/api/get_forum_list/?api_version=1.1
---------------------------------------------------------------------------
HTTPError                                 Traceback (most recent call last)
<ipython-input-10-61ba99fc5336> in <module>()
----> 1 client.get_forum_list(user_api_key=settings.DISQUS_API_KEY)

~/Proyectos/Works/kornov/lib/python3.6/site-packages/disqus/api.py in call_method(**kwargs)
     59         if attr in self.METHODS:
     60             def call_method(**kwargs):
---> 61                 return self.call(attr, **kwargs)
     62             return call_method
     63         raise AttributeError

~/Proyectos/Works/kornov/lib/python3.6/site-packages/disqus/api.py in call(self, method, **params)
     86         request = self._get_request(url, self.METHODS[method], **params)
     87         try:
---> 88             response = urlopen(request)
     89         except URLError:
     90             raise

/usr/lib64/python3.6/urllib/request.py in urlopen(url, data, timeout, cafile, capath, cadefault, context)
    221     else:
    222         opener = _opener
--> 223     return opener.open(url, data, timeout)
    224 
    225 def install_opener(opener):

/usr/lib64/python3.6/urllib/request.py in open(self, fullurl, data, timeout)
    530         for processor in self.process_response.get(protocol, []):
    531             meth = getattr(processor, meth_name)
--> 532             response = meth(req, response)
    533 
    534         return response

/usr/lib64/python3.6/urllib/request.py in http_response(self, request, response)
    640         if not (200 <= code < 300):
    641             response = self.parent.error(
--> 642                 'http', request, response, code, msg, hdrs)
    643 
    644         return response

/usr/lib64/python3.6/urllib/request.py in error(self, proto, *args)
    568         if http_err:
    569             args = (dict, 'default', 'http_error_default') + orig_args
--> 570             return self._call_chain(*args)
    571 
    572 # XXX probably also want an abstract factory that knows when it makes

/usr/lib64/python3.6/urllib/request.py in _call_chain(self, chain, kind, meth_name, *args)
    502         for handler in handlers:
    503             func = getattr(handler, meth_name)
--> 504             result = func(*args)
    505             if result is not None:
    506                 return result

/usr/lib64/python3.6/urllib/request.py in http_error_default(self, req, fp, code, msg, hdrs)
    648 class HTTPDefaultErrorHandler(BaseHandler):
    649     def http_error_default(self, req, fp, code, msg, hdrs):
--> 650         raise HTTPError(req.full_url, code, msg, hdrs, fp)
    651 
    652 class HTTPRedirectHandler(BaseHandler):

HTTPError: HTTP Error 400: BAD REQUEST

SalahAdDin avatar Mar 09 '18 17:03 SalahAdDin