How to login different user each on different pages using class based views

86 views
Skip to first unread message

JJEMBA KENNETH

unread,
Feb 14, 2017, 6:00:54 AM2/14/17
to django...@googlegroups.com
Hello guys,
I started using django a month back and I have been using class based views. they are pretty good. Then am wondering how i can use them to implement different categories of user where each is redirected to a different page.
Can anyone please help me with that.

--
Jjemba Kenneth

ludovic coues

unread,
Feb 14, 2017, 8:24:10 AM2/14/17
to django...@googlegroups.com
I would add a get_redirect_url method on all user model, which give a
different url depending on the user category.
Then use a redirect url with a get_redirect_url method returning the
value of get_redirect_url from the user.

If you want to use url name instead of path, use django.urls.reverse
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALHyo8_6KDbXOXBGDb6Gk1PbkRvsQ7L8H8XK3PK4b36W8_0mmQ%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--

Cordialement, Coues Ludovic
+336 148 743 42
Reply all
Reply to author
Forward
0 new messages