-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@login_required is not defined #140
Comments
Hi @omgitskuei As explained in tutorial extension Homework: Adding security to your website, section Authorizing add/edit of posts, you'll have to import that decorator with from django.contrib.auth.decorators import login_required Put that Does the error still occur if you do that? |
Hi Django Girls, thank you this fixes the NameError. It would be helpful to have this import instruction in the Add Approve/Delete Comments section of your Extensions book. The sections didn't look like they needed to be read in order. |
👍 Good point.
AFAIK, they indeed aren't intended to have to be read in order. Can you make a pull request with that addition? You can find the source file for that section in this repository here at |
Hi, after I add @login_required to functions comment_approve and comment_remove in views.py, I'm getting nameError in the CMD saying "login_required" is not defined.
The text was updated successfully, but these errors were encountered: