I am using django-braces\'s LoginRequiredMixin in a Django 1.6 project. This mixin replicates Django\'s login_required decorator.
I have a view that uses the
The issue is the way the browser interprets the login URL. You want it to be intepreted like this:
/accounts/login/?next="/spa_home/#price_requests/68"
but actually, it is seen like this:
"/accounts/login/?next=/spa_home/"#price_requests/68
In other words, the hash is seen as attaching to the login URL itself, not the redirect parameter.
The way to fix this is to quote the parameter:
urllib.quote('/spa_home/#price_requests/68')
which gives you /spa_home/%23price_requests/68, which will be interpreted correctly.