I am using the Djinga templating engine (which processes both Django and Jinja templates) so I am not sure if this behavior is reproducible either in the vanilla Django template or even Jinja2. The social.apps.django_app.context_processors.login_redirect context processor fails when rendering using the django.template.loader.render_to_string() function.
The reason is very simple: Djinga passes request=None to all context processors when render_to_string is called and login_redirect fails with this kind of input. I am not sure if Djinga is abusing an undocumented Django behavior or login_redirect is the one to blame.
Anyway, the error can be fixed trivially by checking if request is None in the begining of the login redirect function.
login_redirect can't ignore the request is a required parameter, if doesn't fit your current setup, that means that you need a custom function for that particular environment.
I am using the Djinga templating engine (which processes both Django and Jinja templates) so I am not sure if this behavior is reproducible either in the vanilla Django template or even Jinja2. The social.apps.django_app.context_processors.login_redirect context processor fails when rendering using the django.template.loader.render_to_string() function.
The reason is very simple: Djinga passes request=None to all context processors when render_to_string is called and login_redirect fails with this kind of input. I am not sure if Djinga is abusing an undocumented Django behavior or login_redirect is the one to blame.
Anyway, the error can be fixed trivially by checking if request is None in the begining of the login redirect function.