estoy siguiendo un video de como extender dicho modelo, pero no me pasa del makemigrations con diferentes errores.
autenticacion-->models.py
from django.db import models
from django.contrib.auth.models import AbstractUser
from pais.models import Paises
# Create your models here.
class navegante(AbstractUser):
# username = email
# email = email2
cif_nif = models.CharField(max_length=20,blank=False)
pais = models.ForeignKey(Paises,models.SET_NULL,blank=True,null=True)
tlf1 = models.CharField(max_length=10)
tlf2 = models.CharField(max_length=10)
denominacion = models.CharField(max_length=50)
contacto = models.CharField(max_length=50)
#contrato = models.ForeignKey(ContratoCliente,on_delete=models.DO_NOTHING,blank=False,null=False)
inicio_comunicacion = models.DateTimeField()
fin_comunicacion = models.DateTimeField()
settings.py
INSTALLED_APPS = [
...
'autenticacion',
]
AUTH_USER_MODEL = 'autenticacion.navegante'
autenticacion-->admin.py
from django.contrib import admin
from .models import navegante
# Register your models here.
admin.site.register(navegante)
si hago makemigrations. Este error:
SystemCheckError: System check identified some issues:
ERRORS: blog.Post.autor: (fields.E301) Field defines a relation with the model 'auth.User', which has been swapped out. HINT: Update the relation to point at 'settings.AUTH_USER_MODEL'.
Si comento AUTH_USER_MODEL:
#AUTH_USER_MODEL = 'autenticacion.navegante'
Este otro:
d:\webs\ProyectoWeb>python manage.py makemigrations SystemCheckError: System check identified some issues:
ERRORS: autenticacion.navegante.groups: (fields.E304) Reverse accessor 'Group.user_set' for 'autenticacion.navegante.groups' clashes with reverse accessor for 'auth.User.groups'. HINT: Add or change a related_name argument to the definition for 'autenticacion.navegante.groups' or 'auth.User.groups'. autenticacion.navegante.user_permissions: (fields.E304) Reverse accessor 'Permission.user_set' for 'autenticacion.navegante.user_permissions' clashes with reverse accessor for 'auth.User.user_permissions'. HINT: Add or change a related_name argument to the definition for 'autenticacion.navegante.user_permissions' or 'auth.User.user_permissions'. auth.User.groups: (fields.E304) Reverse accessor 'Group.user_set' for 'auth.User.groups' clashes with reverse accessor for 'autenticacion.navegante.groups'. HINT: Add or change a related_name argument to the definition for 'auth.User.groups' or 'autenticacion.navegante.groups'. auth.User.user_permissions: (fields.E304) Reverse accessor 'Permission.user_set' for 'auth.User.user_permissions' clashes with reverse accessor for 'autenticacion.navegante.user_permissions'. HINT: Add or change a related_name argument to the definition for 'auth.User.user_permissions' or 'autenticacion.navegante.user_permissions'.
No sé lo que hace en el video (1BeZxMbSZNI) que yo no haga. He estado mirando las preguntas similares, pero son antiguas y desde mi, mas complejas de lo que estoy intentando. Poco a Poco. ¿Donde puedo estar comentiendo el error? Gracias.