经过6个多小时的挣扎,我决定寻求帮助。
任务:在Django的帮助下创建一个项目
工具:Windows Vista、Putty SSH
地点:Bluehost (www.bluehost.com) 服务器
我已经阅读过有关同一问题的这些主题:
-
-bash:django-admin.py:找不到命令(Django安装)
-
无法使用 django-admin.py
-
Django:创建新项目时,弹出“django-admin.py:命令未找到”错误
-
django-admin.py:找不到命令
-
未找到命令:django-admin.py
-
Django-admin.py 不工作(-bash:django-admin.py:找不到命令)
我已经按照此处的说明安装了 Python(Bluehost 帮助页面):
https://my.bluehost.com/cgi/help/python-install
Python 2.7.2安装并检查,它看起来像:
[email protected] [~/python]# ls
./ ../ Python-2.7.2/ Python-2.7.2.tgz bin/ include/ lib/ share/
目录〜/ python / Python-2.7.2 /看起来像这样:
[email protected] [~/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
and 〜/ python / bin /看起来像这样:
[email protected] [~/python/bin]# ls
./ 2to3* idle* python* python2.7* smtpd.py*
../ django-admin.py* pydoc* python-config@ python2.7-config*
Django 1.5安装并检查,它看起来像:
[email protected] [~/Django-1.5]# ls
./ AUTHORS LICENSE PKG-INFO build/ docs/ scripts/ setup.py
../ INSTALL MANIFEST.in README.rst django/ extras/ setup.cfg tests/
and 〜/Django-1.5/bin/看起来像这样:
usern[email protected] [~/Django-1.5/django/bin]# ls
./ __init__.py django-2to3.py* profiling/
../ daily_cleanup.py* django-admin.py* unique-messages.py*
问题:当我尝试创建项目时,我看到以下错误:
[email protected] [~/www/domain/]# django-admin.py startproject mysite
-bash: django-admin.py: command not found
然后我在没有 .py 的情况下再次尝试,我看到这个错误:
[email protected] [~/www/domain/]# django-admin.py startproject mysite
-bash: django-admin.py: command not found
~/.bashrc 看起来像这样:
# .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
~
~
〜/ bin /看起来像这样:
[email protected] [~/bin]# ls
./ ../
所以我读了很多关于PATH,但我无法让它发挥作用。我应该放弃吗?