Please check this answer https://stackoverflow.com/questions/16824004/django-conditional-login-redirect
On Sat, 11 Jul 2020, 18:22 Kuntal Paul, <[email protected]> wrote: > Thank you for your response. I did this way and it was giving me a 405 > error. I couldn't find my mistake. I was saving both of them as student and > as teacher separately from auth.user. > Also, do I have to provide a separate temple for that view? > > > On Sat, Jul 11, 2020, 10:41 PM oba stephen <[email protected]> wrote: > >> You can consider redirecting to a URL that handles the request. >> >> That is a View function that checks if the user is a student or teacher, >> then renders the respective profiles. >> >> Regards >> >> On Sat, Jul 11, 2020 at 5:58 PM Kuntal Paul <[email protected]> wrote: >> >>> The *LOGIN_REDIRECT_URL* only allowing to redirect to a particular >>> profile page. But in scenarios like where there are *students* and >>> *teachers*, both of them need their specific profile page after login. >>> >>> Using* LOGIN_REDIRECT_URL*, both the teachers and the students are >>> getting redirected to the same profile ( in my case, both of them either >>> entirely to teachers profile or entirely to students profile). >>> >>> How can I set *two login redirects instead of one*? I searched in the >>> documentation, online videos, and everything but couldn't find such. Please >>> help me with resources/codes/guide/etc from where I can learn from and >>> implement. I'm pretty new to this and have tried whatever I know till now. >>> >>> Thank You. >>> >>> -- >>> 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 view this discussion on the web visit >>> https://groups.google.com/d/msgid/django-users/e185b4ba-2219-4a1b-bba2-8ef4e4466682o%40googlegroups.com >>> <https://groups.google.com/d/msgid/django-users/e185b4ba-2219-4a1b-bba2-8ef4e4466682o%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> 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 view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/CAAJsLnqfSPy0VEjpv9TrPS-qcFTWjrtQqhFMMQs8B6qqUX5XOw%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-users/CAAJsLnqfSPy0VEjpv9TrPS-qcFTWjrtQqhFMMQs8B6qqUX5XOw%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > 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 view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CABD8006ftC%3DtPyk%2BFWikZ0mGLGpiNBnFicU6eq2cL-mRcO-LbA%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CABD8006ftC%3DtPyk%2BFWikZ0mGLGpiNBnFicU6eq2cL-mRcO-LbA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAGLHGi4c2yJju-91NAivt_gOeoD%3DyhaUq___VjEuUnADrtoyNw%40mail.gmail.com.

