Error migrate : Typeerror: Required argument 'year' (pos 1) not found

Asked

Viewed 256 times

0

I’m having trouble executing python manage.py migrate, until I create the tables more at the end returns me the following error :

Typeerror: Required argument 'year' (pos 1) not found

someone could help me ?

  • Have you ever migrated? If yes, you can edit or delete the files from the folder migrate (except for init.py), and erase the database.

  • yes I had already done that I find it more strange , then when I go enters the admin of Django returns me the error screen .

  • this happened many times with me tbm, take a look at the comment above, edited with a possible solution

  • Brumazzi I did here as you told me , I erased the Migrations where it was not giving error , I was erasing one by one until the migrate run successfully

  • use the command python manage.py makemigrations and then python manage.py migrate. this will generate the new settings and should be all ok

  • You could put the error stacktrace so it would be easier and simple to help you

  • Higor, post your models, what’s getting the bug and what’s related to it.

  • Higor, by which I searched for the description of the error you posted. It seems that you are trying to assign a default date as datetime.date. Try to use datetime.date.today. That’s all I can get out of what you posted, please post your model so we can be more accurate in our answers.

  • Guys thanks a lot more already worked out here the problem and I was not calling the .now() in my datetime which remains datetime.now()

  • and I also had that back to migrate that had not been wrong para python manage.py migrate ####0035

  • 1

    Dude, you don’t erase the Migrations that Django generates unless it’s really necessary. Every migration you make, it’s worth you spending 1 min reading it to see what it does with your database.

Show 6 more comments
No answers

Browser other questions tagged

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