Sometimes you may want to customize the administration site beyond what is possible through configuration of
ModelAdmin, creation of admin actions, and overriding admin templates. If this is the case, you need to create a custom admin view. With a custom view, you can build any functionality you need. You just have to make sure that only staff users can access your view and that you maintain the admin look and feel by making your template extend an admin template.
Let's create a custom view to display information about an order. Edit the
views.py file of the
orders application and add the following code to it:
from django.contrib.admin.views.decorators import staff_member_required from django.shortcuts ...