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 trial

Python

@login_required does not work for me

I used the @login_required decorator with the quiz_create(request, course_pk) function as explained in the video and I logged in through the admin but I ran into couple problems.

1- in the view, user.is_authenticated is not true and so I can't see the create quiz button. 2- when I remove the the condition user.is_authenticated, then I can see the create quiz button but when I click on it I get the following error;

Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/accounts/login/?next=/courses/1/create_quiz/

Could someone please help me find out why I am not logged in? Thanks