如何在django项目中运行manage.py

时间:2016-03-09 15:17:33

标签: python django egg

安装完我的django项目后,我在这里找到了一些文件:

/opt/pkgs/myproject/lib/python2.7/site-packages/myproject-2.3-py2.7.egg/dashboard/management/commands/myjob.py
/opt/pkgs/myproject/lib/python2.7/site-packages/myproject-2.3-py2.7.egg/manage.py

运行python manage.py myjobsudo python manage.py validate时,错误为

python: can't open file 'manage.py': [Errno 2] No such file or directory

运行sudo python /opt/pkgs/myproject/lib/python2.7/site-packages/myproject-2.3-py2.7.egg/manage.py validate

很难看

如何解决?任何有用的文档?

更新

sys.path中:

['', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL']

我无法添加路径" /opt/pkgs/myproject/lib/python2.7/site-packages/myproject-2.3-py2.7.egg/manage.py"到sys.path 永久

0 个答案:

没有答案