[Django] #35680: Add default automatic imports to shell

29 views
Skip to first unread message

Django

unread,
Aug 14, 2024, 3:44:57 AM8/14/24
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo | Owner: Salvo Polizzi
Polizzi |
Type: | Status: assigned
Cleanup/optimization |
Component: Core | Version: dev
(Management commands) |
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 |
-------------------------------------+-------------------------------------
It could be useful for the final shell's user to have some default imports
to avoid extra work of customizing to the user. Following this discussion
[https://forum.djangoproject.com/t/default-automatic-imports-in-the-
shell/33708] , it appears that the most used objects are:
- Utilities for date and timezone, namely `datetime` and
`django.utils.timezone` modules
- Utilites for making or debugging database queries, namely
`django.db.models` and `django.db.models.functions`modules
- Settings of your projects, namely `django.conf.settings`
--
Ticket URL: <https://code.djangoproject.com/ticket/35680>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 15, 2024, 9:47:26 AM8/15/24
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* stage: Unreviewed => Accepted
* type: Cleanup/optimization => New feature

Comment:

Accepting following positive forum discussion. Thank you Salvo for raising
this ticket, and working on it!
--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:1>

Django

unread,
Sep 9, 2024, 11:30:20 AM9/9/24
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Salvo Polizzi):

* has_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:2>

Django

unread,
Sep 16, 2024, 10:51:17 AM9/16/24
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1
* needs_docs: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:3>

Django

unread,
Nov 7, 2024, 2:43:57 AM11/7/24
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ülgen Sarıkavak):

* cc: Ülgen Sarıkavak (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:4>

Django

unread,
Feb 14, 2025, 6:33:17 AMFeb 14
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Salvo Polizzi):

* needs_better_patch: 1 => 0
* needs_docs: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:5>

Django

unread,
Feb 14, 2025, 9:37:55 AMFeb 14
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_docs: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:6>

Django

unread,
Feb 18, 2025, 1:41:21 PMFeb 18
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_docs: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:7>

Django

unread,
Feb 25, 2025, 5:12:22 AMFeb 25
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:8>

Django

unread,
Feb 25, 2025, 9:30:25 AMFeb 25
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Salvo Polizzi):

* needs_better_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:9>

Django

unread,
Mar 7, 2025, 10:47:19 AMMar 7
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:10>

Django

unread,
May 30, 2025, 8:35:20 AMMay 30
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* needs_better_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:11>

Django

unread,
Jun 5, 2025, 4:20:17 AMJun 5
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:12>

Django

unread,
Jun 7, 2025, 5:22:15 AMJun 7
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Salvo Polizzi):

* needs_better_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:13>

Django

unread,
Jun 24, 2025, 6:18:17 AMJun 24
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* needs_better_patch: 0 => 1

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:14>

Django

unread,
Jun 29, 2025, 12:04:26 PMJun 29
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Salvo Polizzi):

* needs_better_patch: 1 => 0

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:15>

Django

unread,
Jul 15, 2025, 10:43:38 AMJul 15
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: assigned
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:16>

Django

unread,
Jul 17, 2025, 6:51:53 AMJul 17
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: closed
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"a5cd84ad2002f9a43363ab9fd9d9f6e9dfa48c60" a5cd84a]:
{{{#!CommitTicketReference repository=""
revision="a5cd84ad2002f9a43363ab9fd9d9f6e9dfa48c60"
Fixed #35680 -- Added automatic imports of common utilies to shell
management command.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:17>

Django

unread,
Jul 18, 2025, 7:47:56 AMJul 18
to django-...@googlegroups.com
#35680: Add default automatic imports to shell
-------------------------------------+-------------------------------------
Reporter: Salvo Polizzi | Owner: Salvo
| Polizzi
Type: New feature | Status: closed
Component: Core (Management | Version: dev
commands) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by GitHub <noreply@…>):

In [changeset:"e767bd6838d40893b001c1ad6ba2ab9293527532" e767bd6]:
{{{#!CommitTicketReference repository=""
revision="e767bd6838d40893b001c1ad6ba2ab9293527532"
Refs #35680 -- Sorted shell default autoimports to prevent isort
mismatches.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35680#comment:18>
Reply all
Reply to author
Forward
0 new messages