Retry on database connection failures

Hi folks!

I have a question about database connection: Is it possible to make Django retry on database connection failures?

According to the official documentation, Django will close the db connection if it’s no longer alive (https://docs.djangoproject.com/en/3.1/ref/databases/#persistent-connections). Is there a way (a library or configuration setting) to make it retry on connection errors instead of closing it directly?

Thanks!