Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRajesh Kumar
12,733 PointsDjango login required decorator. Please help
When I add login_required decorator to a view, it redirects me to login page along with the query string (?next=/path/). How can I pass the next parameter to the login view so that after login it is redirected to that URL. When I followed the steps which are 1) Added decorator with @login_required(login_url="/login/") 2) Added a condition in the login view if it is a request.GET redirect it to "next" 3) Added a hidden input in login.html as (<input type='text' name="next" value="{{ next }}">)
I am getting an error message: The page isn't redirecting properly... When I see the console [05/Jun/2017 17:08:59] "GET /Login/?next=/ticket/view/XXXX/ HTTP/1.1" 302 0 [05/Jun/2017 17:08:59] "GET /ticket/view/XXXX/ HTTP/1.1" 302 0
Please help..Thank you.. Rajesh