summaryrefslogtreecommitdiff
path: root/django/core/management/commands/shell.py
AgeCommit message (Collapse)Author
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-07-18Refs #35680 -- Sorted shell default autoimports to prevent isort mismatches.nessita
2025-07-17Fixed #35680 -- Added automatic imports of common utilies to shell ↵Salvo Polizzi
management command.
2025-03-17Fixed #36252 -- Handled duplicate automatic imports in the shell command.hesham942
2025-03-07Fixed #36224 -- Fixed shell imports when settings not configured.Sarah Boyce
Thank you Raffaella for the report. Thank you Tim Schilling and Natalia Bidart for the reviews.
2025-02-13Fixed #36158 -- Refactored shell command to improve auto-imported objects ↵Natalia
reporting.
2025-02-10Refs #35515 -- Fixed shell command verbose output when auto-importing 0 or 1 ↵Natalia
object. Co-authored-by: Salvo Polizzi <salvopolizzi03@gmail.com>
2025-02-10Refs #35515 -- Refactored internal `get_and_report_namespace` in the shell ↵Natalia
command.
2025-01-09Fixed #35515 -- Added automatic model imports to shell management command.Salvo Polizzi
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.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-09-06Refs #32363 -- Made shell ignore a missing sys.___interactivehook__.Peter Inglesby
Thanks Tim Graham for the report. Follow up to 1bbb98d9a4b7d83e422b14ae2429cb368eff5a13.
2021-06-23Fixed #32363 -- Ensured sys.__interactivehook__ is called in shellPeter Inglesby
By default, this means that readline is properly registered, so that .python_history is used. sys.__interactivehook__ may be set by a $PYTHONSTARTUP file.
2020-11-11Fixed #32183 -- Fixed shell crash when passing code with nested scopes.William Schwartz
2020-07-30Bumped minimum isort version to 5.1.0.David Smith
Fixed inner imports per isort 5. isort 5.0.0 to 5.1.0 was unstable.
2020-05-21Fixed #31546 -- Allowed specifying list of tags in ↵Hasan Ramezani
Command.requires_system_checks.
2018-10-19Fixed #29774 -- Fixed django-admin shell hang on startup.Adam Allred
sys.stdin.read() blocks waiting for EOF in shell.py which will likely never come if the user provides input on stdin via the keyboard before the shell starts. Added check for a tty to skip reading stdin if it's not present. This still allows piping of code into the shell (which should have no TTY and should have an EOF) but also doesn't cause it to hang if multi-line input is provided.
2018-07-02Removed parser.add_arguments() arguments that match the defaults.Claude Paroz
2017-09-07Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham
This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
2017-07-06Fixed #27670 -- Prevented shell crash on error in .pythonrc.Peter Inglesby
2017-06-28Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().Mads Jensen
2017-04-24Renamed "Mac OS X" to "macOS" in docs.Michiel Beijen
2017-01-25Refs #23919 -- Removed misc Python 2/3 references.Tim Graham
2017-01-17Refs #25838 -- Removed the deprecated shell --plain option.Tim Graham
2017-01-12Fixed #27721 -- Added interface name to shell's IPython/bython import error.Peter Inglesby
2017-01-09Fixed #27707 -- Removed shell support for IPython < 1.0.Tim Graham
2016-12-21Fixed #27600 -- Suppressed the REPL during shell's reading from stdin.jpic
Thanks Adam Chainz for review and guidance.
2016-08-05Fixed #27023 -- Prevented possibility of shell loading ~/.pythonrc.py twice.Peter Inglesby
2016-04-08Fixed E128 flake8 warnings in django/.Tim Graham
2016-03-08Fixed #26289 -- Enabled shell tab completion on systems using libedit.Saúl Ibarra Corretgé
2016-01-06Fixed #25680 -- Added django-admin shell --command option.Niels Van Och
Add a -c option to the shell command to execute a command passed as a string as Django.
2015-12-22Fixed #25838 -- Added "python" as an interface to the shell command.Jon Dufresne
Deprecates the "--plain" option.
2014-06-19Fixed #22835 -- Deprecated NoArgsCommand.Maxime Turcotte
2014-06-14Converted remaining management commands to argparseClaude Paroz
2014-01-20Fixed #16905 -- Added extensible checks (nee validation) frameworkRussell Keith-Magee
This is the result of Christopher Medrela's 2013 Summer of Code project. Thanks also to Preston Holmes, Tim Graham, Anssi Kääriäinen, Florian Apolloner, and Alex Gaynor for review notes along the way. Also: Fixes #8579, fixes #3055, fixes #19844.
2013-12-30Populated the app registry earlier at startup.Aymeric Augustin
Refs #1796, #21676.
2013-12-29Stopped calling get_models() for a side effect.Aymeric Augustin
2013-12-24Renamed AppCache to Apps.Aymeric Augustin
Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
2013-12-22Moved apps back in the toplevel django namespace.Aymeric Augustin
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
2013-12-17Moved the new app cache inside core.Aymeric Augustin
2013-12-17Removed module-level functions for the app cache.Aymeric Augustin
Since the original ones in django.db.models.loading were kept only for backwards compatibility, there's no need to recreate them. However, many internals of Django still relied on them. They were also imported in django.db.models. They never appear in the documentation, except a quick mention of get_models and get_app in the 1.2 release notes to document an edge case in GIS. I don't think that makes them a public API. This commit doesn't change the overall amount of global state but clarifies that it's tied to the app_cache object instead of hiding it behind half a dozen functions.
2013-12-17Moved django.db.models.loading to django.apps.cache.Aymeric Augustin
This commit doesn't contain any code changes; it's purely a refactoring.
2013-07-30Added support for IPython.start_ipython in shellMinRK
IPython 1.0 introduces an actual stable public API function for starting a normal (non-embedded) IPython session. This is an official public API, which is promised to survive implementation changes.
2013-01-24Fixed #6682 -- Made shell's REPL actually execute $PYTHONSTARTUP and ↵Ramiro Morales
`~/.pythonrc.py`. Also: * Added a ``--no-startup`` option to disable this behavior. Previous logic to try to execute the code in charge of this funcionality was flawed (it only tried to do so if the user asked for ipython/bpython and they weren't found) * Expand ``~`` in PYTHONSTARTUP value. Thanks hekevintran at gmail dot com for the report and initial patch. Refs #3381.
2012-12-31Fixed #17078 -- Made shell use std IPython startup.Ramiro Morales
This allows for a behavior more in line with what is expected by Ipython users, e.g. the user namespace is initialized from config files, startup files. Thanks Benjamin Ragan-Kelley from the IPython dev team for the patch.
2012-08-29[py3] Ported the 'shell' management command.Aymeric Augustin
The user module and the execfile function were removed in Python 3. Thanks Linovia for the report.
2012-07-17Adds interpreter option to shell command as per ticket #18639Mike Grouchy
Specify python interpreter interface ipython or bpython with the -i, --interface options argument. ex// python manage.py shell -i bpython ex// python manage.py shell --interface bpython Like all other options, defaults to default python interpreter when your selected choice isn't available. updated documentation where appropriate
2012-07-10Changed `manage.py shell`'s help text to reflect that it can invoke bpython.Alex Gaynor
2012-01-19Fixed #17078: properly invoke IPython 0.12.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17379 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-10Kill some more dead code.Alex Gaynor
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16795 bcc190cf-cafb-0310-a4f2-bffc1f526a37