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

194
Vistas
Django error: multiple default values for specified column "id"

I'm working with a project with docker-compose, where I have a postgre container.

When I run:

docker-compose -f dev.yml run django python manage.py migrate

I get the error:

django.db.utils.ProgrammingError: multiple default values specified for column "id" of table "scrapy_scrapy"

That is happening before I made some changes to my models.py file. But now the file is correct and should be working. This is the content of the models.py file:

from django.db import models
import django

# Create your models here.
class Scrapy(models.Model):
    user = models.CharField(max_length=50,blank=True)
    password = models.CharField(max_length=50,blank=True)
    projecte = models.CharField(max_length=100)
    estat_last_check = models.CharField(max_length=700, default="", blank=True)
    date = models.DateTimeField(default=django.utils.timezone.now, blank=True)

    app_label = ''
    def __str__(self):              # __unicode__ on Python 2
        return self.projecte + " - " + self.user

    class Meta:
        app_label = 'scrapy'

As you can see, no id filed is defined anymore, so, why is complaining about that field?

I've done my research and tried some possible solutions, but no luck. I've already tried deleting the full Docker container and creating it again, or trying to delete the database.

Any ideas?

about 4 years ago · Santiago Trujillo
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