Run shell_plus through PyCharm?

前端 未结 7 630
独厮守ぢ
独厮守ぢ 2020-12-28 17:11

Is there a way for me to configure PyCharm to run shell_plus instead of the default shell?

I\'ve tried putting the text of the manage command in the \'Starting scr

7条回答
  •  独厮守ぢ
    2020-12-28 17:45

    In Django 1.7, following script can be used as a workaround with PyCharm 3.4:

    File -> Settings -> Console -> Django Console and manage.py options

    In Starting script, put:

    import sys
    import django
    django.setup()
    
    from django.db.models import get_models
    
    for _class in get_models():
        globals()[_class.__name__] = _class
    

提交回复
热议问题