Skip to content

Django's 'shell' command should use the Python Interactive window #13027

Closed as not planned

Description

@rchiodo

The tutorial for Django has this command:

python manage.py shell

It would be cool if this could use the interactive window instead (it opens an ipython kernel)

Activity

  1. rchiodo commented on Jul 17, 2020

    @rchiodo
    Author

    I believe this would work if we set the DJANGO_SETTINGS_MODULE environment variable before starting.

    (See here for more information: https://www.b-list.org/weblog/2007/sep/22/standalone-django-scripts/)

  2. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Jul 20, 2020
  3. added
    needs spikeLabel for issues that need investigation before they can be worked on.
    and removed
    needs proposalNeed to make some design decisions
    on Aug 12, 2020
  4. eleanorjboyd commented on Dec 14, 2023

    @eleanorjboyd

    Anthony Kim (@anthonykim1) curious of your thoughts on this and if this is something that could relate to your repl work.

  5. anthonykim1 commented on Dec 14, 2023

    @anthonykim1

    Thanks Eleanor Boyd (@eleanorjboyd)
    There are still much work and sorting that needs to happen between plain REPL in Python for VS Code vs. Interactive Window . I know Django is a web framework but still lacking some context for Django shell other than its a shell that reads settings.py and goes and find all application in settings.py and then preload those application then gives you a shell.

    Rich Chiodo (@rchiodo) Are there any specific reasons you wanted to use Python Interactive window and/or iPython? This would be helpful in thinking about what is needed in REPL rewrite that is happening #21707 and the native VS Code REPL experience towards the end of the rewrite.

  6. rchiodo commented on Dec 14, 2023

    @rchiodo
    Author

    Oh so you could get intellisense and have the output like a notebook window. Here's a good demonstration of the django shell:

    https://www.nickmccullum.com/useful-features-django-shell/

    It looks a lot like an IPython shell.

  7. rchiodo commented on Dec 14, 2023

    @rchiodo
    Author

    Meaning you'd run python code to check how things look.

  8. changed the title [-]Django projects 'shell' command should use the Python Interactive window[/-] [+]Django's 'shell' command should use the Python Interactive window[/+] on Dec 18, 2023
  9. anthonykim1 commented on Dec 9, 2024

    @anthonykim1

    Now we have intellisense via Native REPL, but it might still be helpful to merge this issue with #13027 since I assume there are some scripts and environment variables that are Django specific that we can set before launching each Native REPL session. Folks who were interested in this issue, please go ahead and upvote the referenced issue #13027

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-replfeature-requestRequest for new features or functionalityneeds spikeLabel for issues that need investigation before they can be worked on.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions