Reputation: 1613
I'm building an ecommerce site with django. I want to build a page that lists out all the orders created on a certain day, but i only want my staff to be able to have access to this page. How can i do this?
Upvotes: 2
Views: 141
Reputation: 1275
If by staff, you mean the is_staff
flag and not a custom group, then you can use this decorator before your view
from django.contrib.admin.views.decorators import staff_member_required
@staff_member_required
... view ...
Upvotes: 2