Hello,
You can use django-allauth for authentication and authorization (Login,
Logout, Signup, Email verification etc)
django-allauth tutorial <https://wsvincent.com/django-allauth-tutorial/>
then in settings.py add  LOGIN_REDIRECT_URL = 'yourapp:nameofurl'
then in the corresponding view you can write a function
def get_redirect_url(self):
if self.request.user.groups.filter(name='user').exists():
return reverse("users:home")
# return reverse("users:somethingelse")

you can add group to users from admin page
Thanks and Regards,

Najmath Ummer
Perleybrook Labs LLC
Mob:8075314478


On Tue, 14 May 2019 at 09:18, salimon jamiu olashile <
[email protected]> wrote:

> Hey, I think you can do this by adding conditionals to your template to
> handle the data sent from the view.
> Regards
>
> On Mon, 13 May 2019 at 3:29 PM, MUHAMMAD AFZAL <[email protected]>
> wrote:
>
>> You could solve this problem in templates itself by placing form in
>> different positions or using advanced frameworks like bootstrap of react.
>>
>> And in views code, write it separately and Connect it through urls.
>>
>> On May 13, 2019 5:03 PM, "laurine ogutu" <[email protected]> wrote:
>>
>> Hi i have tried to create a login form where a teacher and student can
>> login. Once the teacher clicks the teachers button, they can give their
>> details. Once a student clicks the student button, they can give their
>> details different from the teachers. I have a problem getting it done.
>> Kindly help
>>
>> --
>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> 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/CAPqJkvstQVci1GC%3D%3Dyq%2BxNi%3DjNgfc9YJdR4TbgXUg%2Bm3hzJQ1g%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAPqJkvstQVci1GC%3D%3Dyq%2BxNi%3DjNgfc9YJdR4TbgXUg%2Bm3hzJQ1g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> 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/CAAKmAQppO1YXYcGYTpv%2B_cB773TY-iEAu2o10_Gbidd8-Cadvg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAAKmAQppO1YXYcGYTpv%2B_cB773TY-iEAu2o10_Gbidd8-Cadvg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> 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/CAFhdOCMR92e1CR40cdbQW11VVq1Y5bKxAVeSS2Da%2BOGh4XEKFw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFhdOCMR92e1CR40cdbQW11VVq1Y5bKxAVeSS2Da%2BOGh4XEKFw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/CAP0JBPtKiWqrB%2BCjaOxy-CeJpmVEfr2rkotR5ybXnYUqdkQHqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to