有没有办法使用命令行参数传递给脚本django runscript
?
我尝试运行的脚本使用argparse
接受命令行参数。
命令行执行脚本:
./consumer --arg1 arg1 --arg2 arg2
Both arg1
and arg2
是必需的选项。
我们尝试使用script-args
但无法弄清楚如何在这种情况下使用它。
2020 年更新:使用 --script-args
https://django-extensions.readthedocs.io/en/latest/runscript.html https://django-extensions.readthedocs.io/en/latest/runscript.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)