summaryrefslogtreecommitdiff
path: root/docs/howto
diff options
context:
space:
mode:
authorSalvo Polizzi <salvopolizzi03@gmail.com>2025-01-30 10:47:11 +0100
committerSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-01-30 12:16:16 +0100
commitdfaf8aa6c627df1357947d69a6c1073707e62523 (patch)
treecefa3e44ea564a895a64bd8d7cbdbd8359011cb7 /docs/howto
parenta469397dd36a8691d77539e20a5112b0761e116a (diff)
[5.2.x] Fixed #36159 -- Removed the empty import example in the custom shell docs.
This can be achieved with the --no-imports flag. Backport of b84478ae953d049a1da42c3d0ef3ab3a9467b649 from main.
Diffstat (limited to 'docs/howto')
-rw-r--r--docs/howto/custom-shell.txt13
1 files changed, 0 insertions, 13 deletions
diff --git a/docs/howto/custom-shell.txt b/docs/howto/custom-shell.txt
index 07034dd197..f4df359981 100644
--- a/docs/howto/custom-shell.txt
+++ b/docs/howto/custom-shell.txt
@@ -42,16 +42,3 @@ The above customization adds :func:`~django.urls.resolve` and
:func:`~django.urls.reverse` to the default namespace, which includes all
models from all apps. These two functions will then be available when the
shell opens, without a manual import statement.
-
-If you prefer to not have models automatically imported, create a custom
-``get_namespace()`` that excludes the ``super().get_namespace()`` call:
-
-.. code-block:: python
- :caption: ``polls/management/commands/shell.py``
-
- from django.core.management.commands import shell
-
-
- class Command(shell.Command):
- def get_namespace(self):
- return {}