我想要一个与代码交互的shell,但我不知道是否存在这样的东西。有人能在这一点上帮助我吗?
编辑:
我已经知道我们可以使用 "python manage.py shell",但是我想有一种方式将其插入到代码中,以便我们不必在shell中重新导入所有库。
编辑:
我已经知道我们可以使用 "python manage.py shell",但是我想有一种方式将其插入到代码中,以便我们不必在shell中重新导入所有库。
这个命令可以帮助你加载所有的软件包。
python manage.py shell_plus
参考链接 http://django-extensions.readthedocs.io/en/latest/index.html
这个链接是有关于 Django 扩展的文档,可以帮助你更好地了解和使用 Django 扩展。django-admin shell
或者
python manage.py shell
先进入Django项目根目录,然后在命令行中输入python manage.py shell
,在这里执行视图操作。
/Users/waryak/.virtualenvs/python3.8_django/bin/python3.8 /Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevconsole.py --mode=client --port=49852
python manage.py shell_plus --ptpython
。 - alexzander