无法使用django social auth动态重定向到上次访问过的页面

Mat*_*son 6 django django-socialauth

在特定活动页面上.用户可以使用django social auth登录,但会将它们重定向到静态URL,并使用下面的选项

SOCIAL_AUTH_LOGIN_REDIRECT_URL = '/dashboard/'
Run Code Online (Sandbox Code Playgroud)

我想知道是否有一种动态的方式重定向到他们登录的页面.我试过这个,但它没有用.

{% url socialauth_begin 'facebook' %}?redirect_uri={{ request.get_full_path }}
Run Code Online (Sandbox Code Playgroud)

任何建议都会非常感谢.

马修

And*_*bin 8

根据源代码,您只需要设置?next=.

喜欢{% url socialauth_begin 'facebook' %}?next={{ request.get_full_path }}或者其他字段名称(如果已设置)REDIRECT_FIELD_NAME