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 command shell: buffer unresponsive when runserver
also active
#1669
Comments
runserver
also active
As far as I am aware, Elpy doesn't support interacting with the commands sent to django. I see a way to make it work, but only with Python (not IPython). Is it working if you overwrite (defun elpy-django-command (cmd)
"Prompt user for Django command. If called with `C-u',
it will prompt for other flags/arguments to run."
(interactive (list (completing-read "Command: " (elpy-django--get-commands) nil nil)))
;; Called with C-u, variable is set or is a cmd that requires an argument
(when (or current-prefix-arg
elpy-django-always-prompt
(member cmd elpy-django-commands-with-req-arg))
(setq cmd (concat cmd " " (read-shell-command (concat cmd ": ") "--noinput"))))
(if (string= cmd "shell")
(run-python (concat elpy-django-command " " cmd " -i python")
t t)
(compile (concat elpy-django-command " " cmd)))) |
@galaunay yes, it is working for me, I dont use Ipython so this is good for me.. Thanks EDIT: It'd be nice to include this new function in Elpy for people who learn python with Django and are reading the django manual on their website. Imagine they come accross the section in the django manual where it asks them to interact with the django shell but they are not able to type in it (just as it happened to me). It'd be cool to mention this in the Elpy docs as a gateway for Python people to learn how to use Emacs. What do you think? Would it'd be better to create small videos for this or gifs that show how to use Elpy and Django? I could probably work on any of those two. Let me know. |
Good to know, thanks for noticing it was not working in the first place.
I was thinking about making this the default behaviour in Elpy. In my opinion, there is no point starting a shell if we cannot interact with it. I will just add a note in the documentation to explain why we use python instead of ipython.
We started thinking about producing small videos to present Elpy's features with @sten0 (see #1603). |
Note: I just realised there was other interactive django commands (like |
Summary
I cannot interact with the
python mange.py shell
buffer created withC-c C-x c shell RET
The buffer is unresponsive and does not type anything in the buffer.
Steps to reproduce
C-c C-x r
C-c C-x c shell RET
My configuration
OS
Ubuntu 18
Emacs 26.3
Result of
(elpy-config)
Elpy configuration in my init.el
The text was updated successfully, but these errors were encountered: