Error running makemigrations on my Django project

Asked

Viewed 26 times

1

I am trying to run makemigrations on my Django project but it is returning error saying that the argument default is not expected or something like, follows part of the error:

TypeError: __init__() got an unexpected keyword argument 'dafault'

I do not know what is happening, because in other projects I have already executed classes with practically identical attributes without any mistake happening.

Follow the code excerpt:

class Music(models.Model):
    id_music = models.UUIDField(
        primary_key=True,
        dafault=uuid.uuid4(),
        editable=True,
        unique=True
    )

PS.: I am using Python in version 3.8.6 and Django in version 3.1.6

1 answer

1

class Music(models.Model):
    id_music = models.UUIDField(
        primary_key=True,
        default=uuid.uuid4,
        editable=True,
        unique=True
    )

No need to call the function with ( )

  • Keeps making the same mistake.

  • You sure wrote 'default', right?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.