Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

93
Vistas
Django Unknown column

I have a model with the following fields

class UserProfile(models.Model):

  user = models.OneToOneField(User, unique=True, db_index=True, 
  related_name='profile')
  Email = models.EmailField(max_length=255, db_index=True, null=True)
  name = models.CharField(blank=True, max_length=255, db_index=True)

class Meta(object):
    db_table = "auth_userprofile"

in my Users panel inside the Django Adminsitration i have multiple users, when i try to acces one of them i get this following error

(1054, "Unknown column 'auth_userprofile.user_id' in 'field list'")

should i drop the table to fix this issue or there is another solution for this

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Dropping the table will require you to recreate it. And if you recreate it precisely as it is now, the issue will not be resolved.

This error: (1054, "Unknown column 'auth_userprofile.user_id' in 'field list'")

Is refering to a specified column, very likely in a SQL statement, where you claiming a table, auth_userprofile, has the column: user_id.

Or it could be a syntax error, and you are including the table name in the column name section, or actually quite a lot of possible errors come to mind.

The point is deleting the table will only help if you re-create it with altered column names. And dropping an entire table to either alter a column name in your code, or simply creating the column in the table seems a bit excessive?

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda