[Django] #36159: Update the shell customization tutorial to reflect the --no-imports flag.

2 views
Skip to first unread message

Django

unread,
Jan 30, 2025, 2:52:45 AM1/30/25
to django-...@googlegroups.com
#36159: Update the shell customization tutorial to reflect the --no-imports flag.
-------------------------------------+-------------------------------------
Reporter: Salvo | Owner: Salvo Polizzi
Polizzi |
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: 5.1
Documentation |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The final section of this [https://docs.djangoproject.com/en/dev/ref
/django-admin/#django-admin-shell tutorial] currently states:

''If you prefer to not have models automatically imported, create a custom
get_namespace() that excludes the super().get_namespace() call:''
{{{
from django.core.management.commands import shell

class Command(shell.Command):
def get_namespace(self):
return {}
}}}

----

This section can be replaced with a simpler explanation:

''To disable automatic importing entirely, use the --no-imports flag.''
--
Ticket URL: <https://code.djangoproject.com/ticket/36159>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 30, 2025, 2:54:43 AM1/30/25
to django-...@googlegroups.com
#36159: Update the shell customization tutorial to reflect the --no-imports flag.
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
Type: | Polizzi
Cleanup/optimization | Status: assigned
Component: Documentation | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Salvo Polizzi):

* version: 5.1 => dev

--
Ticket URL: <https://code.djangoproject.com/ticket/36159#comment:1>
Reply all
Reply to author
Forward
0 new messages