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 ?
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 ?
Browser other questions tagged python django
You are not signed in. Login or sign up in order to post.
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.– Brumazzi DB
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 .
– Higor
this happened many times with me tbm, take a look at the comment above, edited with a possible solution
– Brumazzi DB
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
– Higor
use the command
python manage.py makemigrations
and thenpython manage.py migrate
. this will generate the new settings and should be all ok– Brumazzi DB
You could put the error stacktrace so it would be easier and simple to help you
– Marcos Costa Pinto
Higor, post your models, what’s getting the bug and what’s related to it.
– Rubico
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 usedatetime.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.– Rubico
Guys thanks a lot more already worked out here the problem and I was not calling the
.now()
in mydatetime
which remainsdatetime.now()
– Higor
and I also had that back to migrate that had not been wrong
para python manage.py migrate ####0035
– Higor
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.
– Puam Dias