diff --git a/django/db/__init__.py b/django/db/__init__.py index f3cf4574a96..eb8118adb5c 100644 --- a/django/db/__init__.py +++ b/django/db/__init__.py @@ -17,6 +17,7 @@ from django.db.utils import ( from django.utils.connection import ConnectionProxy __all__ = [ + "close_old_connections", "connection", "connections", "router", diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt index 5a31ceeaaea..d98d523db58 100644 --- a/docs/ref/databases.txt +++ b/docs/ref/databases.txt @@ -99,7 +99,8 @@ connections. If a connection is created in a long-running process, outside of Django’s request-response cycle, the connection will remain open until explicitly -closed, or timeout occurs. +closed, or timeout occurs. You can use ``django.db.close_old_connections()`` to +close all old or unusable connections. Encoding --------