6

Django View Authorization: Restricting Access

 3 years ago
source link: https://realpython.com/courses/django-view-authorization/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Django View Authorization: Restricting Access

Django provides tools for both authentication and authorization. Django view authorization is typically done with decorators. This course will show you how to use these view decorators to enforce authorized viewing of pages in your Django site.

By the end of this course you’ll know how to:

  • Use HttpRequest and HttpRequest.user objects
  • Authenticate and authorize users
  • Differentiate between regular, staff, and admin users
  • Secure a view with the @login_required decorator
  • Restrict a view to different roles with the @user_passes_test decorator
  • Use the Django messages framework to notify your users

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK