Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#4888 closed (fixed)

Fix Documentation: User authentication in Django

Reported by: Piotr Lewandowski <django@…> Owned by: nobody
Component: Documentation Version: dev
Severity: Keywords: authentication
Cc: django@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In we read:

An authentication backend is a class that implements two methods:
``get_user(id)`` and ``authenticate(**credentials)``.

The ``get_user`` method takes an ``id`` -- which could be a username, database
ID or whatever -- and returns a ``User`` object.


$ svn cat django/contrib/auth/ | grep get_user
    def get_user(self, user_id):

Additionaly code below may suggest it is complete backend class while it doesn't have get_user() method.

    class MyBackend:
        def authenticate(self, username=None, password=None):
            # Check the username/password and return a User.

Attachments (1)

authentication.txt.diff (1.4 KB) - added by Piotr Lewandowski <django@…> 16 years ago.

Download all attachments as: .zip

Change History (6)

Changed 16 years ago by Piotr Lewandowski <django@…>

Attachment: authentication.txt.diff added

comment:1 Changed 16 years ago by Piotr Lewandowski <django@…>

Cc: django@… added
Summary: Documentation: User authentication in Django fixFix Documentation: User authentication in Django

comment:2 Changed 15 years ago by Simon G. <dev@…>

Triage Stage: UnreviewedReady for checkin

comment:3 Changed 15 years ago by Russell Keith-Magee

Resolution: wontfix
Status: newclosed

I'm not sure I see the value in these changes -- the existing text is accurate (in that it describes the methods they way they are used on a class), and provides a sample wrapper class for explanatory purposes. The proposed patch removes the explanatory context, but add the 'self' method to the examples. I think the existing text is much clearer.

comment:4 Changed 15 years ago by Piotr Lewandowski <django@…>

I can't see the reason why the documentation should be buggy. It clearly states that get_user takes an id whereas it actually takes user_id.

Don't you think that's oversight? You just referred to the second part of this ticket.

comment:5 Changed 15 years ago by Adrian Holovaty

Resolution: wontfixfixed

(In [6297]) Fixed #4888 -- Fixed small confusion in docs/authentication.txt. Thanks, Piotr Lewandowski

Note: See TracTickets for help on using tickets.
Back to Top