question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

allauth>=0.25.0 : __init__() takes exactly 2 arguments (1 given) error

See original GitHub issue
Internal Server Error: /rest-auth/facebook/
Traceback (most recent call last):
  File "/Users/mywork/venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/Users/mywork/venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/mywork/venv/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/Users/mywork/venv/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/Users/mywork/venv/lib/python2.7/site-packages/rest_framework/views.py", line 466, in dispatch
    response = self.handle_exception(exc)
  File "/Users/mywork/venv/lib/python2.7/site-packages/rest_framework/views.py", line 463, in dispatch
    response = handler(request, *args, **kwargs)
  File "/Users/mywork/venv/lib/python2.7/site-packages/rest_auth/views.py", line 50, in post
    self.serializer.is_valid(raise_exception=True)
  File "/Users/mywork/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 213, in is_valid
    self._validated_data = self.run_validation(self.initial_data)
  File "/Users/mywork/venv/lib/python2.7/site-packages/rest_framework/serializers.py", line 410, in run_validation
    value = self.validate(value)
  File "/Users/mywork/venv/lib/python2.7/site-packages/rest_auth/registration/serializers.py", line 63, in validate
    adapter = adapter_class()
TypeError: __init__() takes exactly 2 arguments (1 given)

I just follow installation

from allauth.socialaccount.providers.facebook.views import FacebookOAuth2Adapter
from rest_auth.registration.views import SocialLoginView

class FacebookLogin(SocialLoginView):
    adapter_class = FacebookOAuth2Adapter

urlpatterns = [
...
        url(r'^rest-auth/', include('rest_auth.urls')),
    url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
    url(r'^rest-auth/facebook/$', FacebookLogin.as_view(), name='fb_login'),

]

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
dkvdmcommented, Aug 1, 2016

0.8.1 is on pypi.

0reactions
omidrahacommented, Jul 17, 2016

Current 0.7.0 version of django-rest-auth on the pypi that is last release version have this bug. So please release 0.8.0 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - __init__() takes exactly 2 arguments (1 given)?
I would like to know where am lagging, Looking for your advices.. class Student_Record(object): def __init__(self,s): self.
Read more >
TypeError: __init__() takes exactly 2 arguments (1 given) #25
I had to set the AWS_XRAY_CONTEXT_MISSING setting to LOG_ERROR to avoid it and then got this error. Any help is appreciated.
Read more >
TypeError: __init__() takes exactly 1 argument (2 given)
Getting the error on the line where I try to create the milton instance: class Employee(object): """Models real-life employees!
Read more >
How to solve "TypeError: __init__() takes exactly 2 arguments ...
"Takes exactly 2 arguments" means self , which is automatically supplied, +1 other user-specified argument. This is because RemapRange is a ...
Read more >
Python TypeError: init takes exactly 1 argument 2 given
Python TypeError: init takes exactly 1 argument 2 given. 13K views 7 years ago. ATOM. ATOM. 6.38K subscribers. Subscribe.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found