djangosnippets.org: Latest snippets tagged with 'staff'https://djangosnippets.org/tags/staff/2011-12-14T13:53:07.635320-06:00Django Sudo
2011-12-14T13:53:07.635320-06:00readevalprinthttps://djangosnippets.org/snippets/2628/<p>Staff can log in as a user, from a url to help with customer support or debugging.</p>
Freely redistributablestaff_or_404 Decorator
2011-11-10T17:28:25.334468-06:00bkeatinghttps://djangosnippets.org/snippets/2599/<p>Sometimes I don't want to reveal a staff-only view so I created this decorator, using <code>django.contrib.admin.views.decorators.staff_member_required</code> as my boilerplate. Non staff members are kicked to the 404 curb.</p>
<p>Suggestion: Create a file, <code>decorators.py</code> in your project (or single app) and import like so: <code>from myproject.app_name.decorators import staff_or_404</code>.</p>
Freely redistributableRestrict staff access to admin pages
2010-10-07T09:56:27.935312-05:00slinkhttps://djangosnippets.org/snippets/2227/<p>A middleware that restricts staff members access to administration pages.
</p>
Freely redistributable