After struggling more than 6 hours, I decided to ask for help.
挣扎了6个多小时后,我决定寻求帮助。
Mission: To create a project with the help of Django
Tools: Windows Vista, Putty SSH
Location: Bluehost (www.bluehost.com) Server
任务:在Django工具的帮助下创建一个项目:Windows Vista, Putty SSH位置:Bluehost (www.bluehost.com)服务器
I have already read these topics about the same question:
我已经读过这些关于同一个问题的话题:
-
-bash: django-admin.py: command not found (Django Installation)
- bash:django-admin。py:没有找到命令(Django安装)
-
Unable to use django-admin.py
- 无法使用django-admin.py
-
Django: When creating a new project, “django-admin.py: command not found” Error pops up
- Django:当创建一个新项目时,叫做“Django -admin”。py:命令not found " Error弹出
-
django-admin.py: command not found
- django-admin。py:命令没有找到
-
Command not found: django-admin.py
- 命令未发现:django-admin.py
-
Django-admin.py not working (-bash:django-admin.py: command not found)
- Django-admin。py不工作(bash:django-admin。py:命令未找到)
I have installed Python as explained here (Bluehost Help Page):
https://my.bluehost.com/cgi/help/python-install
我已经按照这里的解释安装了Python (Bluehost帮助页面):https://my.bluehost.com/cgi/help/pythoninstall
Python 2.7.2 installed and checked, and it looks like:
username@domain.com [~/python]# ls
./ ../ Python-2.7.2/ Python-2.7.2.tgz bin/ include/ lib/ share/
the directory ~/python/Python-2.7.2/ looks like this:
目录~/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
and ~/python/bin/ looks like this:
而~/python/bin/看起来是这样的:
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 installed and checked, and it looks like:
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/
and ~/Django-1.5/bin/ looks like this:
而~/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*
Problem: When I try to create my project, I see this error:
问题:当我尝试创建我的项目时,我看到了这个错误:
username@domain.com [~/www/domain/]# django-admin.py startproject mysite
-bash: django-admin.py: command not found
Then I have tried again without .py, I see this error:
然后我又试了一次,没有。py,我看到这个错误:
username@domain.com [~/www/domain/]# django-admin.py startproject mysite
-bash: django-admin.py: command not found
~/.bashrc looks like this:
# .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/ looks like this:
username@domain.com [~/bin]# ls
./ ../
So I read a lot about the PATH, but I could not make it work. Should I give up?
所以我读了很多关于这条路的书,但我没能让它发挥作用。我应该放弃吗?
2 个解决方案
#1
1
Modify your .bashrc
PATH entry to look like:
修改您的.bashrc路径条目,使其看起来如下:
export PATH=$HOME/Django-1.5/bin/:$HOME/.local/bin:$HOME/.local/usr/bin:$PATH
And reload your .bashrc
by doing:
通过以下操作重新加载。bashrc:
# . ~/.bashrc
#2
0
Add django path to your $PATH
.
在$ path中添加django路径。
Change you ~/.bashrc
to
改变你~ /。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
~
~
#1
1
Modify your .bashrc
PATH entry to look like:
修改您的.bashrc路径条目,使其看起来如下:
export PATH=$HOME/Django-1.5/bin/:$HOME/.local/bin:$HOME/.local/usr/bin:$PATH
And reload your .bashrc
by doing:
通过以下操作重新加载。bashrc:
# . ~/.bashrc
#2
0
Add django path to your $PATH
.
在$ path中添加django路径。
Change you ~/.bashrc
to
改变你~ /。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
~
~