【发布时间】:2014-11-30 15:37:36
【问题描述】:
我有以下目录树
myproject
├── data
├── libs
└── wsgi
├── openshift
└── static
openshift 包含设置文件和 manage.py 文件。我想通过 pycharm 来使用 manage.py ,但它不起作用,runserver 命令和 startapp 也没有任何东西是精确的。
运行 startapp 出现以下错误
bash -cl "/usr/bin/python2.7 manage.py startapp quiz"
/usr/bin/python2.7: can't open file 'manage.py': [Errno 2] No such file or directory
Process finished with exit code 2
运行 runserver 它给了我以下信息
ImportError: Could not import settings 'openshift.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named openshift.settings
Process finished with exit code 1
我已启用 django 支持并将 wsig 设置为 django 根项目。从终端运行 manage.py 工作正常。
我做错了什么?
编辑:从 pycharm 运行 manage.py shell 也可以 EDIT2:我设法通过遵循 openshift 的结构并使 openshift 成为 django 项目根文件夹以及对导入的一些编辑来使其工作。现在一切正常
【问题讨论】: