user1050619 user1050619 - 3 months ago 17
Bash Question

Django store shell history

I lost all my history when I login to shell. Inorder to view the history, I installed ipython and tried to use it.

Now, I get a error when I try this command -

ipython manage.py shell_plus --print-sql


[TerminalIPythonApp] CRITICAL | Bad config encountered during
initialization:
[TerminalIPythonApp] CRITICAL | Unrecognized flag: '--print-sql'


Similarly even bpython also does not work.

Answer

You shouldn't use ipython to start the shell. Just use python manage.py... as normal; Django will use IPython as the shell if it's installed.