Implementing separate frontend and backend in Django

Hey everyone! I’m jumping into Django from PHP and Yii2. I’m used to having separate frontend and backend apps with different login systems in Yii2. Now I’m wondering how to do this in Django.

I know Django has an admin site, but I’m not sure if that’s enough for what I need. I want to have:

  1. Two different login pages (one for admins, one for regular users)
  2. Two separate dashboards (again, admin and user panels)

What’s the best way to set this up? Should I try to customize the admin site somehow, or is it better to build these features from scratch?

Any tips or suggestions would be super helpful! Thanks in advance!

While Django’s admin site is powerful, it’s often better to build custom solutions for complex setups like yours. I’d recommend creating separate Django apps for your frontend and backend, each with its own views, templates, and URL configurations. This approach offers more flexibility and control over user experiences.

For authentication, leverage Django’s built-in auth system, but create custom login views and forms for each user type. You can then direct users to different dashboards based on their roles.

Consider using Django’s class-based views and mixins to streamline your code and enforce access controls. Also, look into Django REST Framework if you plan on building an API for your frontend. This structure will give you the separation you’re used to from Yii2 while utilizing Django’s robust features.

ooh, interesting setup! have u thought about using django-allauth? it’s great for multiple auth systems. you could create separate templates for admin/user logins, and use custom user models to differentiate roles. wat about using django rest framework for ur backend? it’d make building separate dashboards easier. just curious, wat specific features do u need in each dashboard?

hey leo! u can totally do this in django. create separate apps for frontend n backend, use different urls and views. for logins, django’s auth system is great - just make custom login views. admin site works but u might wanna customize it. building from scratch gives more control. goodluck!