diff --git a/stude/accounts/models.py b/stude/accounts/models.py index 71a8362..cb03308 100644 --- a/stude/accounts/models.py +++ b/stude/accounts/models.py @@ -1,3 +1,10 @@ +from django.contrib.auth.models import AbstractUser from django.db import models -# Create your models here. + +class CustomUser(AbstractUser): + is_student = models.BooleanField(default=True) + is_admin = models.BooleanField(default=False) + is_banned = models.BooleanField(default=False) + year_level = models.CharField(max_length=50, null=True, blank=True) + semester = models.CharField(max_length=50, null=True, blank=True) diff --git a/stude/config/settings.py b/stude/config/settings.py index 6d1af79..70aae0a 100644 --- a/stude/config/settings.py +++ b/stude/config/settings.py @@ -100,10 +100,17 @@ DATABASES = { } } -EMAIL_HOST = str(os.getenv('EMAIL_HOST')) -EMAIL_HOST_USER = str(os.getenv('EMAIL_HOST_USER')) -EMAIL_HOST_PASSWORD = str(os.getenv('EMAIL_HOST_PASSWORD')) -EMAIL_PORT = str(os.getenv('EMAIL_PORT')) +# Email credentials +if (DEBUG == True): + EMAIL_HOST = str(os.getenv('DEV_EMAIL_HOST')) + EMAIL_HOST_USER = str(os.getenv('DEV_EMAIL_HOST_USER')) + EMAIL_HOST_PASSWORD = str(os.getenv('DEV_EMAIL_HOST_PASSWORD')) + EMAIL_PORT = str(os.getenv('DEV_EMAIL_PORT')) +else: + EMAIL_HOST = str(os.getenv('PROD_EMAIL_HOST')) + EMAIL_HOST_USER = str(os.getenv('PROD_EMAIL_HOST_USER')) + EMAIL_HOST_PASSWORD = str(os.getenv('PROD_EMAIL_HOST_PASSWORD')) + EMAIL_PORT = str(os.getenv('PROD_EMAIL_PORT')) # Password validation # https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators