Okay, this is an update to Django five.
When I recorded this section, the Django five wasn't available, so this is me recording after that.
What are the differences?
Basically, you could do almost everything what we've done in this tutorial, but there are a few things
that has been changed in the Django, and this is adjusting to the newest version of the Django, which
is version five at the moment of recording this video.
So when you run the server and if you don't do the same thing as we've done it in our tutorial, then
you might see this warning.
This is actually just a warning, so it's not an error.
So you can still run your application without any problems, but it's basically telling you that a autocreate
the primary key are used not defining in a primary key type.
So what is that means is when we use a ID auto primary key, then Django doesn't really know which one
to use.
So we could basically this is for for the models like when we have movie, then ID will be automatically
added.
So what we could do is we could tell a Django which one to use.
So I can go to settings and anywhere really in the in the settings I can go for example here I can do
this.
So we need to specify default out of field.
That will be equal.
And I will do quotes here.
And then I can specify out of field will be used.
So like that.
So that means in the settings I will say this is auto field and its coming from the model auto field.
And if I will save it and refresh it now.
You see this warning is gone.
So thats one thing that we can actually fix to add this.
Another thing is that it's not actually telling here, but it's something that has been removed from
Django five, which is this index together.
So we could either remove it completely if we don't need it.
But if you for some reason wants to have that, what we can do is we can actually change it.
So I will do indexes.
So this is the new way how we actually do this.
So I will remove it from now.
So this will be index s is equal to square brackets.
And then we do models index.
And then we can do here field equal to.
And then here we will have an array.
So basically we can say like that.
So this will be our array like this.
So we don't use the indexes to get anymore.
We do indexes.
That is array.
We'll do models index fields user and movie.
So if I'll refresh it now nothing's actually been changed.
But this is the previous method of this was deprecated in the newest version.
So pretty much if you will do this adjustment, all the rest of the things stays the same and they are
the current Django version.