GithubHelp home page GithubHelp logo

Comments (9)

jmb avatar jmb commented on July 18, 2024

In my demo version this works fine - in settings.py I have added these lines:

REST_FRAMEWORK = {
    'DEFAULT_AUTHENTICATION_CLASSES': (
        'rest_framework.authentication.SessionAuthentication',
        'rest_framework.authentication.TokenAuthentication',
   )  
}

I think you may just need the TokenAuthentication, as in rest_auth/serializers.py the LoginSerializer is defined by extending AuthTokenSerializer.

from django-rest-auth.

PaulGregor avatar PaulGregor commented on July 18, 2024

Thanks @jmb . But error still presents. I have a clean demo(or with your modifications), and if login credentials are correct I receive this error. 'LoginSerializer' object has no attribute 'object'

from django-rest-auth.

jmb avatar jmb commented on July 18, 2024

I just tried the clean demo from the master branch and (apart from adding the rest_verify_email fix so I can verify my test user's email) it works fine for me - even without the settings entries, I get back a key/token. Weird.

HTTP 200 OK
Content-Type: application/json
Vary: Accept
Allow: POST, OPTIONS

{
    "key": "90aa22277c5f61b1c85905745e465633f19c0309"
}

from django-rest-auth.

PaulGregor avatar PaulGregor commented on July 18, 2024

I will try another computer and OS, maybe there I'll find luck =)

from django-rest-auth.

mariposa8 avatar mariposa8 commented on July 18, 2024

I had the same issue. And the answer I found (after 2 hours of angriness =)) in "install_requires", here >>> 'djangorestframework>=2.3.13, <3.0'. It means: don't use 3+ version of Django REST Framework. You are welcome! =)

from django-rest-auth.

PaulGregor avatar PaulGregor commented on July 18, 2024

@mariposa8 thank you so much, using djangorestframework <3.0 helped.

from django-rest-auth.

papasax avatar papasax commented on July 18, 2024

thank you so much, using djangorestframework <3.0 helped.

from django-rest-auth.

ConorMcGee avatar ConorMcGee commented on July 18, 2024

Anyone have any idea what's causing this in 3.0?

from django-rest-auth.

ConorMcGee avatar ConorMcGee commented on July 18, 2024

Made this fix myself, seems to be working fine but I need to do more testing.
https://github.com/mcgeeco/django-rest-auth/compare/Tivix:master...master

from django-rest-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.