Beyound django auth - custom login function - where?

12 views
Skip to first unread message

Aitch

unread,
Apr 30, 2010, 10:44:44 AM4/30/10
to Django users
I'm fearful this is a really dumb question but I'll go ahead anyway.

My app is starting to need to go beyond basic auth. e.g. when a user
logs in, I need to check various related statuses, provide distinct
messages, set session vars and such like.

What's not clear to me is, if I provide my own login() method (one
that calls auth.authenticate, auth.login etc, and doing my custom
activities as per docs) ... where (how) is it considered best practice
to implement this?

Problem is similar to that described half way down here:
http://www.djangobook.com/en/2.0/chapter14/

Do I create a separate app dedicated to this task, or simply embed it
in an existing one?

Thanks, H

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

derek

unread,
May 1, 2010, 4:15:21 PM5/1/10
to Django users
On Apr 30, 4:44 pm, Aitch <hgl...@gmail.com> wrote:
> I'm fearful this is a really dumb question but I'll go ahead anyway.
>
> My app is starting to need to go beyond basic auth. e.g. when a user
> logs in, I need to check various related statuses, provide distinct
> messages, set session vars and such like.
>
> What's not clear to me is, if I provide my own login() method (one
> that calls auth.authenticate, auth.login etc, and doing my custom
> activities as per docs) ... where (how) is it considered best practice
> to implement this?
>
> Problem is similar to that described half way down here:http://www.djangobook.com/en/2.0/chapter14/
>
> Do I create a separate app dedicated to this task, or simply embed it
> in an existing one?

Aitch

Not dumb. I think this would be a useful blog post. That aside... I
think signals are the way to go. Look at recent posts on this topic
(some linked to my name), e..g to "set session variables". I have not
got this working yet, but if you do, perhaps you can "write up" some
guidelines?

Derek
Reply all
Reply to author
Forward
0 new messages