A

Admin • 828.03K Points
Coach

Q. Which decorator is used to restrict access to a Django view to authenticated users?

  • (A) @require_login
  • (B) @login_required
  • (C) @authenticated
  • (D) @user_only
  • Correct Answer - Option(B)
  • Views: 12
  • Filed under category Django
  • Hashtags:

Explanation by: Admin
The `@login_required` decorator ensures that only logged-in users can access the view.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.