Django allauth, manage redirect

1,173 views
Skip to first unread message

Branko Zivanovic

unread,
Feb 7, 2017, 3:39:34 AM2/7/17
to Django users
I'm using django-allauth for authentication. I've enabled Facebook and Google for social logins. How do I make redirect after first login? I want to make people edit their profiles instantly after their first login.

pradam programmer

unread,
Feb 7, 2017, 4:20:21 AM2/7/17
to django...@googlegroups.com
Hi,
add this line in settings.py:
LOGIN_REDIRECT_URL = "/my-tasks/"

On Tue, Feb 7, 2017 at 2:09 PM, Branko Zivanovic <internati...@gmail.com> wrote:
I'm using django-allauth for authentication. I've enabled Facebook and Google for social logins. How do I make redirect after first login? I want to make people edit their profiles instantly after their first login.

--
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+unsubscribe@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/70fcb12c-f1fc-41b1-944d-47d5c0c756f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Branko Zivanovic

unread,
Feb 7, 2017, 4:30:18 AM2/7/17
to Django users
Thanks for the answer.
This will redirect user after every single login, right?
I wan't it to be after firsty login only, so people can update their profile. I want this to be done only once.

уторак, 07. фебруар 2017. 10.20.21 UTC+1, pradam.programming је написао/ла:
Hi,
add this line in settings.py:
LOGIN_REDIRECT_URL = "/my-tasks/"
On Tue, Feb 7, 2017 at 2:09 PM, Branko Zivanovic <internati...@gmail.com> wrote:
I'm using django-allauth for authentication. I've enabled Facebook and Google for social logins. How do I make redirect after first login? I want to make people edit their profiles instantly after their first login.

--
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.

Michal Petrucha

unread,
Feb 7, 2017, 4:51:36 AM2/7/17
to Django users
On Tue, Feb 07, 2017 at 01:30:18AM -0800, Branko Zivanovic wrote:
> Thanks for the answer.
> This will redirect user after every single login, right?
> I wan't it to be after firsty login only, so people can update their
> profile. I want this to be done only once.

Not exactly what you're asking for, but one option might be to define
a custom “get_login_redirect_url” method as described in the docs [1],
and check either based on the account creation timestamp, or maybe add
another field to your model that will indicate whether the user has
already completed that step of the sign-up process or not.

Good luck,

Michal


[1]: https://django-allauth.readthedocs.io/en/latest/advanced.html#custom-redirects
signature.asc

Branko Zivanovic

unread,
Feb 7, 2017, 6:08:52 AM2/7/17
to Django users
Thanks for idea, I think this one with additional field might work!
Reply all
Reply to author
Forward
0 new messages