Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

propagating ?next= in django-registration

I have a view that has the @login_required decorator and upon pulling up the page, if you are not logged in it does send you to the login form with the proper ?next=/url/you/tried/to/see

My problem is how to I pass along that ?next value to the subsequent forms and activation email so that when the user completes the activation process they are redirected to the view they originally tried to get to.

My Python'foo and Django'foo is weak, so please keep the answer to something a 5 year old could follow ;)

Thanks all in advanced.

like image 381
ChronosLLC Avatar asked Jul 04 '10 20:07

ChronosLLC


2 Answers

Built in view handles this by default. Make sure you have this piece of code: <input type="hidden" name="next" value="{{ next }}" /> in your template of login page.

like image 137
dzida Avatar answered Oct 08 '22 20:10

dzida


You can do this <a href="{% url 'app:sign_up' %}?next={{ next }}">

like image 30
Uchechukwu Orji Avatar answered Oct 08 '22 20:10

Uchechukwu Orji