I wrote some code for Register step, i made all the verification on my code in models.py, forms.py, views.py but when i try to signup i have an error i can't register the data in my database(postgresql)/
And i verified, there is non "login_user" in my code
my app is called login.
So this is my /login/models.py code:
from django.db import models
from django.core.validators import RegexValidator
from django.contrib.auth.models import AbstractUser, PermissionsMixin
# Create your models here.
class User(AbstractUser, PermissionsMixin):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
otp = models.IntegerField(null=True)
phone_regex = RegexValidator(regex=r'^[+][3][3][6-7][0-9]{8}$',
message="Le numéro de téléphone doit être au format: +33xxxxxxxxx\
'0622920182 devient +33622920182'")
phone = models.CharField(validators=[phone_regex], max_length=12)
is_staff = models.BooleanField(default=False)
is_active = models.BooleanField(default=False)
is_superuser = models.BooleanField(default=False)
def __str__(self):
return self.username
This is the error i have : ERREUR: la relation « login_user » n'existe pas LINE 1: SELECT (1) AS "a" FROM "login_user" WHERE "login_user"."user...
Aucun commentaire:
Enregistrer un commentaire