django-admin.py:找不到命令(bluehost server) [英] django-admin.py: command not found (bluehost server)

查看:143
本文介绍了django-admin.py:找不到命令(bluehost server)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经过6个多小时的努力,我决定要求帮助。

After struggling more than 6 hours, I decided to ask for help.

使命:在Django的帮助下创建一个项目

工具:Windows Vista,Putty SSH

位置:Bluehost(www.bluehost.com)服务器

Mission: To create a project with the help of Django
Tools: Windows Vista, Putty SSH
Location: Bluehost (www.bluehost.com) Server

我已经阅读了关于相同问题的这些主题:


  1. - bash:django-admin.py:未找到命令(Django安装)

  2. 无法使用django-admin.py

  3. Django:创建新项目时,django-admin.py:command not found错误弹出

  4. < a href =https://stackoverflow.com/questions/1 1791368 / django-admin-py-command-not-found> django-admin.py:命令未找到

  5. 找不到命令:django-admin.py

  6. ​​ Django-admin.py not working( - bash:django-admin.py:command not found)

  1. -bash: django-admin.py: command not found (Django Installation)
  2. Unable to use django-admin.py
  3. Django: When creating a new project, "django-admin.py: command not found" Error pops up
  4. django-admin.py: command not found
  5. Command not found: django-admin.py
  6. Django-admin.py not working (-bash:django-admin.py: command not found)

我已经安装了Python, (Bluehost帮助页面):
https://my.bluehost.com/ cgi / help / python-install

I have installed Python as explained here (Bluehost Help Page):
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 / / strong>看起来像t他的:

the directory ~/python/Python-2.7.2/ looks like this:

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*



Django 1.5已安装并检查,它看起来像:



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/

〜/ 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,我看到这个错误:

Then I have tried again without .py, I see this error:

username@domain.com [~/www/domain/]# django-admin.py startproject mysite
-bash: django-admin.py: command not found



〜/ .bashrc look像这样:



~/.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 /看起来像这样:



~/bin/ looks like this:

username@domain.com [~/bin]# ls
./  ../

所以我读了很多关于 PATH ,但是我不能让它工作。我应该放弃吗?

So I read a lot about the PATH, but I could not make it work. Should I give up?

推荐答案

修改 .bashrc PATH条目看起来像:

Modify your .bashrc PATH entry to look like:

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

并重新加载您的 .bashrc 通过做:

And reload your .bashrc by doing:

# . ~/.bashrc

这篇关于django-admin.py:找不到命令(bluehost server)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆