有没有办法让我将 PyCharm 配置为运行shell_plus而不是默认 shell?
我尝试将管理命令的文本放在“启动脚本”中,但随后我得到了以下 django_manage_shell.run("/Users/cmason/counsyl/code/website/counsyl/product") import os import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
# The new Django 1.4 default manage.py wants "from django..." before
# importing settings, but we usually tinker with sys.path in
# settings_local.py, which is called from settings.py. Importing
# settings.py works but does mean some double importing. Luckily that
# module does very little work.
import settings
# appease pyflakes; don't ever do this in
# non-super-meta-namespace-trickery code
settings
from django.core.management import execute_from_command_line
execute_from_command_line("shellplus")
它并没有真正运行 shell_plus。
似乎“启动脚本”是在默认情况下发生的,而不是默认情况下发生的。
Shell_plus 自动导入所有 Django 模型类等。