i have model as in below
from django.db import models
from django.contrib.auth.models import AbstractUser
class AppUser(AbstractUser):
user_department = models.CharField(max_length=100)
user_group_email = models.EmailField(max_length=100)
user_company_id = models.CharField(max_length=8)
def __str__(self):
return f"{self.username} {self.last_name} {self.user_department}"
class PowerCustomer(models.Model):
customer_name = models.CharField(max_length=100)
customer_surname = models.CharField(max_length=100)
customer_birth_date = models.DateField()
customer_phone_number = models.CharField(max_length=50)
customer_email = models.EmailField()
customer_origin_country = models.CharField(max_length=100)
customer_has_high_priority = models.BooleanField(default=False)
customer_creation_date = models.DateField()
customer_loyalty_membership_number = models.CharField(max_length=100)
customer_job_type = models.CharField(max_length=100)
customer_description = models.CharField(max_length=370)
user = models.ForeignKey(AppUser, on_delete=models.SET_NULL, null=True, related_name='power_customers')
def __str__(self):
return f"{self.customer_name} {self.customer_surname} {self.customer_job_type} {self.customer_description}"
and i have properly configured installed apps as in below
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'powerlistapp',
]
and i have configured my Auth user as in below
AUTH_USER_MODEL = 'powerlistapp.AppUser',,
and i receive this error when i want to make my migrations.
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'powerlistapp.appuser' that has not been installed
i have deleted my database and delete all migrations and re run python3 manage.py makemigrations. etc
Try to run in your terminal:
and then
If this solution does not help, could you please send your project structure (dir and file names)