Linux 通过django'编写ipython脚本;s shell_plus
我正在编写一个shell脚本,它使用-c选项通过ipython运行命令,如下所示:Linux 通过django'编写ipython脚本;s shell_plus,linux,django,shell,ipython,Linux,Django,Shell,Ipython,我正在编写一个shell脚本,它使用-c选项通过ipython运行命令,如下所示: ipython -c "from blah import myfunct; myfunct()" 但是我想通过django的shell_plus命令调用ipython,这样我就可以利用shell_plus为我自动加载的所有内容: $ ./manage.py shell_plus 我不能在结尾加“-c…”,因为manage.py不知道该怎么处理它。有没有办法以某种方式将-c选项导入管道?有几种方法可以做到这一点
ipython -c "from blah import myfunct; myfunct()"
但是我想通过django的shell_plus命令调用ipython,这样我就可以利用shell_plus为我自动加载的所有内容:
$ ./manage.py shell_plus
我不能在结尾加“-c…”,因为manage.py不知道该怎么处理它。有没有办法以某种方式将-c选项导入管道?有几种方法可以做到这一点
'PYTHONSTARTUP=your_文件。/manage.py shell_plus'
注意:Django检查
PYTHONSTARTUP
是否是带有os.path.isfile(pythonrc)
的文件,这意味着它不会扩展路径。因此,如果您的PYTHONSTARTUP
以~
开头,它将不会被导入