Disabling Django Admin, and creating my own three custom admin dashboards

1,162 views
Skip to first unread message

Wim Olivier

unread,
Nov 8, 2019, 10:35:48 PM11/8/19
to Django users
Hi everyone,

I would like to disable the Django Admin, and create my own custom admin dashboards.
There must be three different types of admin dashboards:
- one for Customers (normal users) where they can do CRUD on their profile and services (URI: /customer/dashboard)
- one for Partners where they can do CRUD on their users/customers, and their Customers' profile and services (URI: /partner/dashboard)
- one for Super Users where they can do CRUD on Customers, Partners, and everything else (URI: /administration)

I understand very well the ways to extend the User model - that part I'm OK with.

Just some practical pointers with a small example, or links to Django-based repos that implement something like this, please.
I just need some guidance.

Many thanks!
Wim Olivier
South Africa

Motaz Hejaze

unread,
Nov 9, 2019, 3:44:58 AM11/9/19
to django...@googlegroups.com
If you dont want django admin just remove it from installed apps , middleware and urls..

But i dont advice you to do this , you can make you own dashboards and keep django default admin panel ..

You need a 3 signup pages and 3 login pages , each signup page will create a different user and each login page will login each user type to his dashboard type ..
 I advice you to make a 3 seperate apps to organize the code ..

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/66befa62-2c5b-4d3d-9653-1c8169ccdcc2%40googlegroups.com.

Wim Olivier

unread,
Nov 11, 2019, 1:13:51 AM11/11/19
to Django users
Thanks Motaz,

That gives me a little bit of direction.
I'm thinking now of controlling access to each app's URL's via a single piece of middleware (instead of at each View - just have to figure out how to do that.

Regards,
Wim


On Saturday, 9 November 2019 10:44:58 UTC+2, Motaz Hejaze wrote:
If you dont want django admin just remove it from installed apps , middleware and urls..

But i dont advice you to do this , you can make you own dashboards and keep django default admin panel ..

You need a 3 signup pages and 3 login pages , each signup page will create a different user and each login page will login each user type to his dashboard type ..
 I advice you to make a 3 seperate apps to organize the code ..

On Sat, 9 Nov 2019, 5:34 am Wim Olivier, <wimol...@gmail.com> wrote:
Hi everyone,

I would like to disable the Django Admin, and create my own custom admin dashboards.
There must be three different types of admin dashboards:
- one for Customers (normal users) where they can do CRUD on their profile and services (URI: /customer/dashboard)
- one for Partners where they can do CRUD on their users/customers, and their Customers' profile and services (URI: /partner/dashboard)
- one for Super Users where they can do CRUD on Customers, Partners, and everything else (URI: /administration)

I understand very well the ways to extend the User model - that part I'm OK with.

Just some practical pointers with a small example, or links to Django-based repos that implement something like this, please.
I just need some guidance.

Many thanks!
Wim Olivier
South Africa

--
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...@googlegroups.com.

Motaz Hejaze

unread,
Nov 11, 2019, 1:39:10 AM11/11/19
to django...@googlegroups.com
I dont know what is your authentication based on , but i faced such a scenario ..

One of the solutions is to make a middleware that checks the user type with the url prefix

So usertype1 all related routes will be under /usertype1/

usertype2 all related routes will be under /usertype2/

Middleware will check user_type fron sessions or jwt ( depends on your auth system ) and compare it with the requested url , if they are identical then permission guaranteed , else redirect somewhere
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8b2bcb0b-803c-4da2-9d33-225bd6fcb9b7%40googlegroups.com.

Wim Olivier

unread,
Nov 11, 2019, 2:07:13 AM11/11/19
to django...@googlegroups.com
Great, thanks man!
I will try that.
Using local auth and PostgreSQL - no cloud services.

Regards!
Wim

You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/1vviNQbdp2U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHV4E-c1EcLfpdDRdVnaT0Cyd9_6kF%2BioDr%3Dy_4hKP6HovChBw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages