Open rchiodo opened 4 years ago
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/)
@anthonykim1 curious of your thoughts on this and if this is something that could relate to your repl work.
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.
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.
Meaning you'd run python code to check how things look.
The tutorial for Django has this command:
It would be cool if this could use the interactive window instead (it opens an ipython kernel)