Creating separate admin and user interfaces in Django application

I’m just starting with Django and coming from a PHP background using Yii2 framework. In my previous Yii2 projects, I always created two separate applications - one for regular users and another for administrators, each with their own authentication system.

Now I want to build something similar in Django. I know Django has a built-in admin interface, but I’m not sure how to replicate the same dual-app structure I used in Yii2.

What I need is:

  • Two separate login pages (one for admins, one for regular users)
  • Two different dashboards after login
  • Separate authentication handling for each user type

Should I create multiple admin site instances or build custom views from scratch?

I dealt with this exact thing in a Django project last year. Here’s what worked: I extended the built-in User model with a custom user type field and set up separate URL patterns for each interface. Instead of multiple admin sites, I built custom views for the admin dashboard and kept Django’s regular admin for backend stuff. The trick is using Django’s @user_passes_test decorator to control access based on user type. Make two separate base templates and view mixins - one for regular users, another for admins. For auth, just override the default login view so it redirects users to the right dashboard after they log in. You’ll get the separation you’re used to from Yii2 without breaking Django’s auth system.

nice approach with the custom views! did you run into session management issues with two different login flows? and what about password resets - did you build separate reset views for each user type or just reuse django’s built-in ones?

skip the admin sites - go with custom views instead. create separate apps like admin_panel and user_portal. add a boolean field like is_staff_user to your user model to tell them apart. then write middleware that checks the user type and redirects to the right dashboard after login. much cleaner than hacking multiple admin instances.