I actually confused right now on how to implement the Multi-User Access with Django v5.3. I am actually new in this backend and I would like to create a login where users can redirect to specific dashboards based on their accesslevel type (Providers,Admin,Validator,Students).
Here is the app that I made so far… I have no views yet because I am not confident enough to my models.py but I hope this is good enough.
from django.db import models
from django.conf import settings
from django.contrib.auth.models import AbstractUser
# Create your models here.
class User(AbstractUser):
is_student = models.BooleanField(default=False)
is_validator = models.BooleanField(default=False)
is_provider = models.BooleanField(default=False)
is_admin = models.BooleanField(default=False)
class Student(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
avatar = models.FileField
address = models.CharField(max_length=50)
gwa = models.FloatField(max_length=100)
graduated_at = models.CharField(max_length=100)
year = models.DateField()
class Validators(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
avatar = models.FileField
address = models.CharField(max_length=50)
class Provider(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
company_address = models.CharField(max_length=100)
phone_no = models.CharField(max_length=11)
company_website = models.CharField(max_length=100)
avatar = models.FileField
class Admin(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
avatar = models.FileField(upload_to='avatars')
user24629604 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.