Django-facebook not redirecting to a specific page

106 Views Asked by At

I am using django-facebook- https://github.com/tschellenbach/Django-facebook for authentication. However I am not able to get the login redirect to configure properly.

The documentation says use this code to make the redirection work

<form action="{% url 'facebook_connect' %}?facebook_login=1" method="post">
<input type="hidden" value="{{ request.path }}" name="next" />
<input type="hidden" value="{{ request.path }}" name="register_next" />
<input type="hidden" value="{{ request.path }}" name="error_next" />
{% csrf_token %}
<input onclick="F.connect(this.parentNode); return false;" type="image" src="{{ STATIC_URL}}django_facebook/images/facebook_login.png" />
</form>

I am using the same code as above but the login always redirects to

http://localhost:8000/#_=_ 
1

There are 1 best solutions below

0
Peter Rosemann On

Have a look at

LOGIN_REDIRECT_URL

Default: '/accounts/profile/'

The URL where requests are redirected after login when the contrib.auth.login view gets no next parameter.

https://docs.djangoproject.com/en/1.6/ref/settings/