Custom Django Admin Pages

24 views
Skip to first unread message

Kyle Mulka

unread,
Aug 20, 2018, 11:48:27 PM8/20/18
to Django users
Hi there,

It seems like Django Admin is designed to work with Django models. But, I'm wondering what the best way is to create custom admin pages that don't revolve around Django models. Like, maybe there's a third party API that I want admins to be able to call from the Django admin. What's the best way to get custom pages to show up and render in the Django admin?

Thanks,

Kyle

Vineet Kothari

unread,
Aug 21, 2018, 12:15:18 AM8/21/18
to django...@googlegroups.com
It will be a bad practise you can disable dango admin and create a new app admin but it will require efforts

Sent from my Huawei Mobile
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/57ccf869-829c-4ed4-881b-3b2031834bee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jani Tiainen

unread,
Aug 21, 2018, 3:58:44 AM8/21/18
to django...@googlegroups.com
Hi.

Admin is designed to be datacentric view to your models, namely providing simple CRUD ops to your data.

If you want something else which involves your business requirements and logic, generic class based views do help there. But in any case, you should build your own management console for your business needs.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.



--
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

Derek

unread,
Aug 22, 2018, 2:43:02 AM8/22/18
to Django users
The Django admin is great and will probably provide an 80/20 solution if you have a purely internal app, used by people who understand data management.  For an externally facing app, used by non-technical people, I would recommend a custom design.

The Django admin is not hard to customise quite extensively and it has many "hooks" to allow you to do so. (Many blog posts on this topic.)

I don't think there is one preferred way, but typically you would write your own views & forms and then have the results displayed in templates, which in turn inherit from the Django admin to keep the look-and-feel consistent. You can then hook these into the main menu system.  This is my approach for creating a set of custom reports for a Django app.  For more granular level changes, you can add in custom actions to deal with some of the business operations.  As always, try and keep your business logic associated with your models.

HTH
Reply all
Reply to author
Forward
0 new messages