Twitter login: 401 Client error: authorization required

I use python-social-auth to implement twitter local login, but I get 401 client error. My django version is 1.6.

Traceback:
File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response
  112.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Library/Python/2.7/site-packages/social/apps/django_app/utils.py" in wrapper
  45.             return func(request, backend, *args, **kwargs)
File "/Library/Python/2.7/site-packages/social/apps/django_app/views.py" in auth
  12.     return do_auth(request.social_strategy, redirect_name=REDIRECT_FIELD_NAME)
File "/Library/Python/2.7/site-packages/social/actions.py" in do_auth
  25.     return strategy.start()
File "/Library/Python/2.7/site-packages/social/strategies/base.py" in start
  66.             return self.redirect(self.backend.auth_url())
File "/Library/Python/2.7/site-packages/social/backends/oauth.py" in auth_url
  99.         token = self.set_unauthorized_token()
File "/Library/Python/2.7/site-packages/social/backends/oauth.py" in set_unauthorized_token
  158.         token = self.unauthorized_token()
File "/Library/Python/2.7/site-packages/social/backends/oauth.py" in unauthorized_token
  177.                                 method=self.REQUEST_TOKEN_METHOD)
File "/Library/Python/2.7/site-packages/social/backends/base.py" in request
  205.         response.raise_for_status()
File "/Library/Python/2.7/site-packages/requests/models.py" in raise_for_status
  808.             raise HTTPError(http_error_msg, response=self)

Exception Type: HTTPError at /login/twitter/
Exception Value: 401 Client Error: Authorization Required

The documentation suggests installing ntp. I don't know how to install ntp.

+4
source share
2 answers

Turns out I left the callback URL field blank in the Twitter app console. Although, this is not required, but insert http://127.0.0.1:8000/complete/twitter/(note the slash at the end) completed the task.

+5
source

, "/" URL- , .

http://127.0.0.1:8000/complete/twitter/
+2

All Articles