经过6个多小时的挣扎,我决定寻求帮助。
使命:在Django的帮助下创建项目
工具:Windows Vista,Putty SSH
位置:Bluehost(www.bluehost.com)服务器
我已经阅读了有关同一问题的这些主题:
我按照此处的说明安装了Python(Bluehost帮助页面):
https://my.bluehost.com/cgi/help/python-install
username@domain.com [~/python]# ls
./ ../ Python-2.7.2/ Python-2.7.2.tgz bin/ include/ lib/ share/
目录〜/ python / Python-2.7.2 / 如下所示:
username@domain.com [~/python/Python-2.7.2]# ls
./ LICENSE Objects/ build/ pyconfig.h.in
../ Lib/ PC/ config.log python*
.hg_archival.txt Mac/ PCbuild/ config.status* python-gdb.py
.hgtags Makefile Parser/ configure* setup.py
Demo/ Makefile.pre Python/ configure.in
Doc/ Makefile.pre.in README install-sh*
Grammar/ Misc/ RISCOS/ libpython2.7.a
Include/ Modules/ Tools/ pyconfig.h
和〜/ python / bin / 看起来像这样:
username@domain.com [~/python/bin]# ls
./ 2to3* idle* python* python2.7* smtpd.py*
../ django-admin.py* pydoc* python-config@ python2.7-config*
username@domain.com [~/Django-1.5]# ls
./ AUTHORS LICENSE PKG-INFO build/ docs/ scripts/ setup.py
../ INSTALL MANIFEST.in README.rst django/ extras/ setup.cfg tests/
和〜/ Django-1.5 / bin / 看起来像这样:
username@domain.com [~/Django-1.5/django/bin]# ls
./ __init__.py django-2to3.py* profiling/
../ daily_cleanup.py* django-admin.py* unique-messages.py*
问题:当我尝试创建项目时,我看到了这个错误:
username@domain.com [~/www/domain/]# django-admin.py startproject mysite
-bash: django-admin.py: command not found
然后我再次尝试没有.py,我看到了这个错误:
username@domain.com [~/www/domain/]# django-admin.py startproject mysite
-bash: django-admin.py: command not found
# .bashrc
export PATH=$HOME/.local/bin:$HOME/.local/usr/bin:$PATH
#User specific aliases and functions
alias mv='mv -i'
alias rm='rm -i'
alias cp='cp -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
~
~
username@domain.com [~/bin]# ls
./ ../
所以我读了很多关于 PATH 的内容,但我无法让它发挥作用。我应该放弃吗?
答案 0 :(得分:2)
修改您的.bashrc
路径条目,如下所示:
export PATH=$HOME/Django-1.5/bin/:$HOME/.local/bin:$HOME/.local/usr/bin:$PATH
通过执行以下操作重新加载.bashrc
# . ~/.bashrc
答案 1 :(得分:1)
将django路径添加到$PATH
。
将~/.bashrc
更改为
# .bashrc
export PATH=$HOME/.local/bin:$HOME/.local/usr/bin:$HOME/Django-1.5/bin/:$PATH
#User specific aliases and functions
alias mv='mv -i'
alias rm='rm -i'
alias cp='cp -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
~
~