From fc28550fe4e0582952993976edc62971bd5345a8 Mon Sep 17 00:00:00 2001 From: Salvo Polizzi <101474753+salvo-polizzi@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:00:29 +0100 Subject: Fixed #35515 -- Added automatic model imports to shell management command. Thanks to Bhuvnesh Sharma and Adam Johnson for mentoring this Google Summer of Code 2024 project. Thanks to Sarah Boyce, David Smith, Jacob Walls and Natalia Bidart for reviews. --- docs/ref/django-admin.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'docs/ref/django-admin.txt') diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 128abe5587..c393154d88 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -1065,6 +1065,19 @@ Mails the email addresses specified in :setting:`ADMINS` using Starts the Python interactive interpreter. +All models from installed apps are automatically imported into the shell +environment. Models from apps listed earlier in :setting:`INSTALLED_APPS` take +precedence. For a ``--verbosity`` of 2 or higher, the automatically imported +objects will be listed. To disable automatic importing entirely, use the +``--no-imports`` flag. + +See the guide on :ref:`customizing this behaviour +` to add or remove automatic imports. + +.. versionchanged:: 5.2 + + Automatic models import was added. + .. django-admin-option:: --interface {ipython,bpython,python}, -i {ipython,bpython,python} Specifies the shell to use. By default, Django will use IPython_ or bpython_ if -- cgit v1.3