user7454692
user7454692

Reputation:

Interactive shell in Django

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.

Upvotes: 6

Views: 16396

Answers (4)

Ladenkov Vladislav
Ladenkov Vladislav

Reputation: 1297

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

Upvotes: 0

vinay kumar
vinay kumar

Reputation: 593

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

Upvotes: 9

Cadmus
Cadmus

Reputation: 665

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

Upvotes: 1

JoseKilo
JoseKilo

Reputation: 2443

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

django-admin shell

Or

python manage.py shell

Upvotes: 3

Related Questions