Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rchiodo opened this issue Jul 17, 2020 · 5 comments
Open

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

rchiodo opened this issue Jul 17, 2020 · 5 comments
Assignees
Labels
area-repl feature-request Request for new features or functionality needs spike Label for issues that need investigation before they can be worked on.

Comments

@rchiodo
Copy link

rchiodo commented Jul 17, 2020

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)

@rchiodo rchiodo added feature-request Request for new features or functionality triage-needed Needs assignment to the proper sub-team labels Jul 17, 2020
@rchiodo
Copy link
Author

rchiodo commented Jul 17, 2020

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/)

@karthiknadig karthiknadig added the needs proposal Need to make some design decisions label Jul 20, 2020
@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Jul 20, 2020
@luabud luabud added needs spike Label for issues that need investigation before they can be worked on. and removed needs proposal Need to make some design decisions labels Aug 12, 2020
@eleanorjboyd
Copy link
Member

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

@anthonykim1
Copy link

anthonykim1 commented Dec 14, 2023

Thanks @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.

@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.

@rchiodo
Copy link
Author

rchiodo commented Dec 14, 2023

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.

@rchiodo
Copy link
Author

rchiodo commented Dec 14, 2023

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

@brettcannon brettcannon changed the title Django projects 'shell' command should use the Python Interactive window Django's 'shell' command should use the Python Interactive window Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-repl feature-request Request for new features or functionality needs spike Label for issues that need investigation before they can be worked on.
Projects
None yet
Development

No branches or pull requests

5 participants