S

Shyam Dubey • 3.70K Points
Extraordinary

Q. What does the login_required decorator do?

  • (A) Checks if the user has admin rights
  • (B) Redirects to login page if user is not authenticated
  • (C) Registers a user
  • (D) Logs out the user
  • Correct Answer - Option(B)
  • Views: 9
  • Filed under category Django
  • Hashtags:

Explanation by: Shyam Dubey
login_required ensures a view is accessible only to logged-in users.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.