jmfederico/django-use-email-as-username

Error running makemigrations from fresh project

Closed this issue · 4 comments

  • Django use Email as Username version: 1.1.1
  • Django version: 3.0.6
  • Python version:3.7.6
  • Operating System:MacOS

Description

Initial makemigrations fails to run, raising an error.

What I Did

  • Created a new environment via python3 -m venv .venv and activated source .venv/bin/activate
  • Created a new Django project called "tutorial"
  • Inside the Django project created an app called "email_username"
  • Configured app admin.py, apps.py, and models.py as per instructions
  • Configured project settings.py by adding the 2 apps to installed and set AUTH_USER_MODEL="email_username.User"
  • Finally, I ran python manage.py makemigrations and received:

ValueError: The field auth.User.groups was declared with a lazy reference to 'email_username.group', but app 'email_username' doesn't provide model 'group'.

Did you create the "email_username" app with django-admin.py startapp email_username or with python3 manage.py create_custom_user_app email_username?

Do you mind sharing your code?

I have not been able to replicate, maybe I am not following the same path you did.

I used the django-admin startapp email_username command.

I started a brand new project, followed all my previous steps and was also unable to replicate the error. I wonder if some other apps I had installed in my working project were causing conflicts?

There should be no conflicts unless they shared the namespace.

And apart from AUTH_USER_MODEL, nothing else is altered in Django with the custom_user app.

I am going to close this issue given that it was not possible to reproduce it.

Please feel free to reopen it if needed.