2

I am using the wonderful python-social-authpackage, and more precisely the social-auth-app-django version since my project is using the Django Framework.

Once the user is registered/logged in via any social backend, I'd like to redirect the user to their own very user profile.

I know I can set a static URL in my settings.pysuch as:

SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/logged-in/'

But how can I dynamically redirect the user to their profile given that I know their username/slug?

If I could set variables in the settings.py it'd be something like:

SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/accounts/<slug:slug>/'

But of course I can't do that.

Is there any way I can achieve what I want?

Dalvtor
  • 3,160
  • 3
  • 21
  • 36

0 Answers0