我厌倦了每次打开Django shell时都输入from account_import.models import ImportFile
.有没有办法在我启动shell时自动运行这个命令?
我厌倦了每次打开Django shell时都输入from account_import.models import ImportFile
.有没有办法在我启动shell时自动运行这个命令?
安装django extensions,它的功能之一(shell_plus)是为模型提供上下文.
所以,你可以用./manage.py shell_plus
代替./manage.py shell
,这样所有的东西都可以导入.