Interactive shell in Django
Asked Answered
N

4

6

I would like to get an interactive shell with the code, but I don't even know if such thing exits. Could anyone be able to help me at this point?

EDIT :

I already know we could use python manage.py shell, but I would like something we could insert in the code in such a way we do not have to re-import all the libraries in the shell.

Neron answered 24/2, 2017 at 15:58 Comment(0)
K
9

This command will help you to load all packages.

python manage.py shell_plus

Reference link http://django-extensions.readthedocs.io/en/latest/index.html

Kicksorter answered 24/2, 2017 at 16:30 Comment(1)
you can use ptpython with this and that is so cool; just like python manage.py shell_plus --ptpythonWillardwillcox
P
3

Try with https://docs.djangoproject.com/en/1.10/ref/django-admin/#shell

django-admin shell

Or

python manage.py shell
Pour answered 24/2, 2017 at 16:0 Comment(2)
Sorry, this is not answer my question.Neron
Not answer to question.Blas
R
1

root the django project then python manage.py shell do the views actions here.

Retaliation answered 24/2, 2017 at 16:3 Comment(1)
Sorry, this is not answer my question.Neron
T
0

You also can use a pydev console in PyCharm, which can load anything you want, if you set up it in PyCharm's preferences.

Mine is here:

/Users/waryak/.virtualenvs/python3.8_django/bin/python3.8 /Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevconsole.py --mode=client --port=49852
Tael answered 18/6, 2020 at 19:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.