django pre_save get old instance

The pre_save signal in Django allows you to perform tasks before a model's save method is called. To get the old instance in the pre_save signal, you can utilize the sender argument along with the instance argument to access the original instance before it is updated. This can be achieved by using the pre_save.connect() method to connect a function to the pre_save signal for the specific model. Inside the connected function, you can compare the instance argument with the one retrieved from the database using the sender argument to access the original instance before the changes are applied. This comparison will allow you to obtain the old instance and perform any necessary actions based on the changes.