django-admin.py:找不到命令(BlueHost的服务器)(django-admin.p

2019-08-18 02:27发布

挣扎6个多小时后,我决定寻求帮助。

使命:使用Django的帮助下创建项目
工具:Windows Vista中,腻子SSH
地点:BlueHost的(www.bluehost.com)服务器

我已经读到了同样的问题,这些主题:

  1. -bash:django-admin.py:找不到命令(Django的安装)
  2. 无法使用django-admin.py
  3. Django的:当创建一个新项目,“django-admin.py:命令未找到”错误弹出
  4. django-admin.py:命令未找到
  5. 找不到命令:django-admin.py
  6. Django-admin.py不工作(-bash:django-admin.py:命令未找到)

我已经安装了Python作为这里(BlueHost的帮助页)解释说:
https://my.bluehost.com/cgi/help/python-install

Python的2.7.2安装和检查,它看起来像:

username@domain.com [~/python]# ls
./  ../  Python-2.7.2/  Python-2.7.2.tgz  bin/  include/  lib/  share/

目录〜/蟒蛇/ 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

〜/蟒蛇/斌/看起来是这样的:

username@domain.com [~/python/bin]# ls
./   2to3*             idle*   python*         python2.7*         smtpd.py*
../  django-admin.py*  pydoc*  python-config@  python2.7-config*

Django的1.5安装和检查,它看起来像:

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 /斌/看起来是这样的:

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中看起来是这样的:

# .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,但我不能使它工作。 我应该放弃吗?

Answer 1:

修改您.bashrc路径条目的样子:

export PATH=$HOME/Django-1.5/bin/:$HOME/.local/bin:$HOME/.local/usr/bin:$PATH

并重装.bashrc这样做:

# . ~/.bashrc


Answer 2:

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
~
~


文章来源: django-admin.py: command not found (bluehost server)