diff options
| author | Salvo Polizzi <101474753+salvo-polizzi@users.noreply.github.com> | 2025-01-09 17:00:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-09 13:00:29 -0300 |
| commit | fc28550fe4e0582952993976edc62971bd5345a8 (patch) | |
| tree | caf9428df753d1266dec97cffb3d4571cceacab7 /docs/ref | |
| parent | 8c118c0e00846091c261b97dbed9a5b89ceb79bf (diff) | |
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.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/django-admin.txt | 13 |
1 files changed, 13 insertions, 0 deletions
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 +<customizing-shell-auto-imports>` 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 |
