Next query parameter doesn't work with django allauth for facebook login

I have implemented User account management into my application using Django all-auth. I have enabled login using username and password as well as with facebook connect.

The problem goes like this:

1) User visits a page and clicks login

2) He's taken to

3) When the user logs in using username and password, the user is redirected back to But if the user logs in with facebook, he's taken to homepage.

How can I get desired behavior with Facebook login too?


You need to override the get_login_redirect_url method of django-allauth.

For this inherit the DefaultAccountAdapter class as

from allauth.account.adapter import DefaultAccountAdapter

class MyAccountAdapter(DefaultAccountAdapter):
    def get_login_redirect_url(self, request):
        # get the next parameter from request object and return the url 

And make changes on


This should work !

Need Your Help

Why does my div class push other elements on my page?

html css

I have a little floating box that when hovered, moves out and shows text, but when i insert it into a page it either gets pushed out of place, or it pushes the whole site down just for it to have s...

Trying to get video to Auto play & repeat in aspx

html loops video autoplay

I'm making a portfolio at the moment, and I want an mp4 file running in the background.. I know how to get it to loop & repeat, but apparently i can't figure out how to do it at the same time.....