Sunday, April 16, 2023

Re[2]: Overriding the default django admin panel with a fully customized Rest Framework + React Dashboard

Hi Ryan,

You can override a lot in Django's admin; replacing templates and css are the easiest approach, which is what you can easily find information for doing so.

Going beyond that may require overriding a lot more, but monkey-patching the admin code can get you a surprisingly long way down the road with extending what is possible with Django's admin. But, of course, maintaining that long-term against Django updates is an entirely different story. It can be painful, and ultimately not really worth doing (imo).

But you may need to completely replace the admin app for what you want. Django and React (or almost any spa framework) work entirely differently. You may not have much of an idea of the scope of what you are asking. I don't say this to discourage you from trying - you would learn a lot in the process, and it is undoubtedly possible given the resources - only saying that this is likely much larger than you might expect.

Check out Wagtail, which is a CMS implemented on Django. It provides a fully featured editor-friendly admin, sporting an API and React-driven front-end. It may do all that you are looking for out of the box, but in any case shouldl provide some valuable insight.

HTH,
David
 

------ Original Message ------
From "Ryan Nowakowski" <ryan@fattuba.com>
Date 4/16/2023 7:42:23 AM
Subject Re: Overriding the default django admin panel with a fully customized Rest Framework + React Dashboard

Yup, just remove admin from your urls.py and replace it with your own.

https://docs.djangoproject.com/en/4.2/ref/contrib/admin/#hooking-adminsite-instances-into-your-urlconf

On April 15, 2023 11:18:49 AM CDT, Kimanxo <saadaouiismailmed@gmail.com> wrote:
Hello Devs, I Wish you're doing okay .

Im currently working on a Blood Analysis Lab related project, the project should provide basic website description and CRUD functionalities concerning the blood exams, their status, ...


Basically, I have a custom design for the admin panel where the website should be managed from, however , the built in django admin panel is lacking lot of features that i want to implement.


The question is :
Im using React with django, can I just create a custom template using react and rest framework and override the admin app ?
Meaning that if I go to localhost:8000/admin, it should no longer display the default django admin panel, instead it should display my fully custom react + drf driven dashboard.


If yes, please give me a good guide & resource to learn more about itx because most of the resources I found were simply changing CSS colors of the default panel.


Thank you 

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6404DC59-0BE8-40AA-948E-6DF431CC0CDA%40fattuba.com.

No comments:

Post a Comment