'Django Related model 'vendor.newuser' cannot be resolved
NewUser app in the settings.py
ALLOWED_HOSTS = []
LOGIN_URL ='login'
LOGIN_REDIRECT_URL ='vendor_admin'
LOGOUT_REDIRECT_URL ='home'
AUTH_USER_MODEL = 'vendor.NewUser'
models.py its only the app and also dont pay attetin to the (-() its just diffren languge
class NewUser(AbstractBaseUser,PermissionsMixin):
email = models.EmailField(_('ایمیل'),max_length=255,unique=True)
username = models.CharField(_('نام کاربری'),max_length=255, unique=True)
realstate= models.CharField(_('نام املاک'),max_length=80)
date_joined= models.DateTimeField(_('تاریخ ثبت نام'),auto_now_add=True)
last_login = models.DateTimeField(_('اخرین_ورود'), auto_now=True)
is_admin = models.BooleanField(default=False)
is_active = models.BooleanField(default=True)
is_staff = models.BooleanField(default=False)
is_superuser = models.BooleanField(default=False)
profile_pic = models.ImageField(_('عکس پروفایل'),max_length=255 ,upload_to=get_profile_image_filepath,null=True ,blank=True, default=get_default_profile_image)
objects = CustomAccountManger()
USERNAME_FIELD = "email"
REQUIRED_FIELDS = ["username"]
def __str__(self):
return self.username
def get_profile_image_filenames(self):
return str(self.profile_pic)[str(self.profile_pic).index(f'uploads/{self.pk})/'):]
this happens when i try to migrate
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
