I've tried many things, but I'll write what I currently have implemented.
models.py
I do `makemigrations` and I'm getting this error:
Some nice people on the internet have advised to remove the `AUTH_USER_MODEL` line in `settings.py`. when I remove that line and run `makemigrations` I get:
I've been spending a day on this, am really lost, and would love some direction.
Thanks!
-- admin.py
admin.site.register(User, UserAdmin)
models.py
class User(AbstractUser):
phone = models.CharField(max_length=40, unique=True)
settings.py
AUTH_USER_MODEL = 'user_text.UserAdmin'
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 337, in execute
django.setup()
File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 108, in populate
app_config.import_models()
File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/binny/Development/politikal/user_text/models.py", line 7, in <module>
from django.contrib.auth.admin import UserAdmin
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/admin.py", line 7, in <module>
from django.contrib.auth.forms import (
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/forms.py", line 22, in <module>
UserModel = get_user_model()
File "/usr/local/lib/python2.7/dist-packages/django/contrib/auth/__init__.py", line 198, in get_user_model
"AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings.AUTH_USER_MODEL
django.core.exceptions.ImproperlyConfigured: AUTH_USER_MODEL refers to model 'user_text.UserAdmin' that has not been installed
Some nice people on the internet have advised to remove the `AUTH_USER_MODEL` line in `settings.py`. when I remove that line and run `makemigrations` I get:
auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes with reverse accessor for 'User.groups'.
HINT: Add or change a related_name argument to the definition for 'User.groups' or 'User.groups'.
auth.User.user_permissions: (fields.E304) Reverse accessor for 'User.user_permissions' clashes with reverse accessor for 'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'User.user_permissions' or 'User.user_permissions'.
user_text.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes with reverse accessor for 'User.groups'.
HINT: Add or change a related_name argument to the definition for 'User.groups' or 'User.groups'.
user_text.User.user_permissions: (fields.E304) Reverse accessor for 'User.user_permissions' clashes with reverse accessor for 'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'User.user_permissions' or 'User.user_permissions'.
I've been spending a day on this, am really lost, and would love some direction.
Thanks!
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ee778413-2451-477a-9c98-408567ff41e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment