title: how to login with registered phone number and password in Django
body: <p>here is the code for registration with email and password but how to do with phone number i have</p>
  <p><em><strong>models.py</strong></em></p>
  <pre><code>from django.db import models
  from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
  
  
  class MyAccountManager(BaseUserManager):
      def create_user(self, email, username, password=None):
          if not email:
              raise ValueError(&quot;Users must have an email address&quot;)
          if not username:
              raise ValueError(&quot;Users must have an username&quot;)
  
          user  = self.model(
                  email=self.normalize_email(email),
                  username=username,
              )
  
          user.set_password(password)
          user.save(using=self._db)
          return user
  
      def create_superuser(self, email, username, password):
          user  = self.create_user(
                  email=self.normalize_email(email),
                  password=password,
                  username=username,
              )
          user.is_admin = True
          user.is_staff = True
          user.is_superuser = True
          user.save(using=self._db)
          return user
  
  
  class Account(AbstractBaseUser):
      email                   = models.EmailField(verbose_name=&quot;email&quot;, max_length=60, unique=True)
      username                = models.CharField(max_length=30, unique=True)
      date_joined             = models.DateTimeField(verbose_name='date joined', auto_now_add=True)
      last_login              = models.DateTimeField(verbose_name='last login', 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)
      # first_name                = models.CharField(max_length=30)
  
      USERNAME_FIELD = 'email'
      REQUIRED_FIELDS = ['username', ]
  
      objects = MyAccountManager()
  
      def __str__(self):
          return self.email
  
      def has_perm(self, perm, obj=None):
          return self.is_admin
  
      def has_module_perms(self, app_label):
          return True
  </code></pre>
  <p>whenever i was trying to createsuper the it gives me the following error</p>
  <p>Traceback (most recent call last):
  File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\backends\utils.p
  y&quot;, line 86, in _execute
  return self.cursor.execute(sql, params)
  File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\backends\sqlite3
  \base.py&quot;, line 396, in execute
  return Database.Cursor.execute(self, query, params)
  sqlite3.OperationalError: no such table: account_account</p>
  <p>The above exception was the direct cause of the following exception:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;manage.py&quot;, line 21, in &lt;module&gt;
      main()
    File &quot;manage.py&quot;, line 17, in main
      execute_from_command_line(sys.argv)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\core\management\__i
  nit__.py&quot;, line 401, in execute_from_command_line
      utility.execute()
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\core\management\__i
  nit__.py&quot;, line 395, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\core\management\bas
  e.py&quot;, line 328, in run_from_argv
      self.execute(*args, **cmd_options)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\contrib\auth\manage
  ment\commands\createsuperuser.py&quot;, line 79, in execute
      return super().execute(*args, **options)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\core\management\bas
  e.py&quot;, line 369, in execute
      output = self.handle(*args, **options)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\contrib\auth\manage
  ment\commands\createsuperuser.py&quot;, line 113, in handle
      error_msg = self._validate_username(username, verbose_field_name, database)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\contrib\auth\manage
  ment\commands\createsuperuser.py&quot;, line 234, in _validate_username
      self.UserModel._default_manager.db_manager(database).get_by_natural_key(usernam
  e)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\contrib\auth\base_u
  ser.py&quot;, line 44, in get_by_natural_key
      return self.get(**{self.model.USERNAME_FIELD: username})
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\models\manager.p
  y&quot;, line 82, in manager_method
      return getattr(self.get_queryset(), name)(*args, **kwargs)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\models\query.py&quot;
  , line 411, in get
      num = len(clone)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\models\query.py&quot;
  , line 258, in __len__
      self._fetch_all()
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\models\query.py&quot;
  , line 1261, in _fetch_all
      self._result_cache = list(self._iterable_class(self))
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\models\query.py&quot;
  , line 57, in __iter__
      results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=sel
  f.chunk_size)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\models\sql\compi
  ler.py&quot;, line 1152, in execute_sql
      cursor.execute(sql, params)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\backends\utils.p
  y&quot;, line 100, in execute
      return super().execute(sql, params)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\backends\utils.p
  y&quot;, line 68, in execute
      return self._execute_with_wrappers(sql, params, many=False, executor=self._exec
  ute)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\backends\utils.p
  y&quot;, line 77, in _execute_with_wrappers
      return executor(sql, params, many, context)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\backends\utils.p
  y&quot;, line 86, in _execute
      return self.cursor.execute(sql, params)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\utils.py&quot;, line
  90, in __exit__
      raise dj_exc_value.with_traceback(traceback) from exc_value
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\backends\utils.p
  y&quot;, line 86, in _execute
      return self.cursor.execute(sql, params)
    File &quot;C:\Users\TIKAMS~1\DJANGO~1\env\lib\site-packages\django\db\backends\sqlite3
  \base.py&quot;, line 396, in execute
      return Database.Cursor.execute(self, query, params)
  django.db.utils.OperationalError: no such table: account_account
  </code></pre>
  <p>please give me the suggestions if you can it will be great help</p>