ValueError with custom user

ValueError: The field admin.LogEntry.user was declared with a lazy reference to ‘authentication.customuser’, but app ‘authentication’ doesn’t provide model ‘customuser’. The field authentication.UserProfile.user was declared with a lazy reference to ‘auth’

PS C:\Users\Hp\Desktop\my final year project\django_project\init_auth_django-master> python manage.py migrate
Operations to perform:
  Apply all migrations: admin, auth, authentication, contenttypes, sessions
Traceback (most recent call last):
  File "C:\Users\Hp\Desktop\my final year project\django_project\init_auth_django-master\manage.py", line 22, in <module>
    main()
  File "C:\Users\Hp\Desktop\my final year project\django_project\init_auth_django-master\manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "C:\Users\Hp\Desktop\my final year project\venv\Lib\site-packages\django\core\management\__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "C:\Users\Hp\Desktop\my final year project\venv\Lib\site-packages\django\core\management\__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "C:\Users\Hp\Desktop\my final year project\venv\Lib\site-packages\django\core\management\base.py", line 413, in run_from_argv
    self.execute(*args, **cmd_options)
  File "C:\Users\Hp\Desktop\my final year project\venv\Lib\site-packages\django\core\management\base.py", line 459, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Hp\Desktop\my final year project\venv\Lib\site-packages\django\core\management\base.py", line 107, in wrapper
    res = handle_func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Hp\Desktop\my final year project\venv\Lib\site-packages\django\core\management\commands\migrate.py", line 302, in handle
    pre_migrate_apps = pre_migrate_state.apps
                       ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Hp\Desktop\my final year project\venv\Lib\site-packages\django\utils\functional.py", line 47, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
                                         ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Hp\Desktop\my final year project\venv\Lib\site-packages\django\db\migrations\state.py", line 566, in apps
    return StateApps(self.real_apps, self.models)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Hp\Desktop\my final year project\venv\Lib\site-packages\django\db\migrations\state.py", line 637, in __init__
    raise ValueError("\n".join(error.msg for error in errors))
ValueError: The field admin.LogEntry.user was declared with a lazy reference to 'authentication.customuser', but app 'authentication' doesn't provide model 'customuser'.
The field authentication.UserProfile.user was declared with a lazy reference to 'authentication.customuser', but app 'authentication' doesn't provide model 'customuser'.
PS C:\Users\Hp\Desktop\my final year project\django_project\init_auth_django-master>

Welcome @lisa928 !

Just a couple things to point out here.

  • Please don’t try to describe the complete issue in the title. The title should be a brief statement of the issue. The full description should be in the body of your post.

  • When posting code (or templates, error messages, tracebacks, etc), enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted. (I’ve taken the liberty of editing your original post. Please remember to do this in the future.)

Please provide more details about your project. Describe what sort of user and profile models you’re using, and what you have done with this project so far. (i.e., is this an existing project you are enhancing? Or is this a new project where you’re just getting started?)

I’m building on existing project

What changes have you made to the project since the last working version?

I added RSA and AES cryptography functionalities and I wanted to add two factor authentication using Twilio sms during login.

You’re going to need to provide all the details about these changes.

Also, did you start your project with a custom user model, or are you adding this as part of these updates?

I created the CustomUser function inside authentication model