创建第一个django异常处理

找不到django-admin.py命令

[root@mail python]# django�\admin.py startproject mysite
-bash: django�\admin.py: command not found
[root@mail python]# which django-admin
/usr/bin/which: no django-admin in (/bak/software/jdk1.6.0_23/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/oracle/bin:/opt/oracle/product/11.2.0/dbhome_1/bin:/root/bin)

但django确实是已安装完的

[root@mail python]# python
Python 2.7.6 (default, Feb 13 2014, 14:52:21)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.VERSION
(1, 6, 2, 'final', 0)
>>>

这是就是没有加入环境变量中

[root@mail Django-1.6.2]# ln -s /usr/local/python2.7/lib/python2.7/site-packages/django/bin/django-admin.py /usr/local/bin/django-admin.py

但还有新问题,没有权限

[root@mail python]# django-admin.py startproject mysite
-bash: /usr/local/bin/django-admin.py: Permission denied

就赋予权限

[root@mail python]# chmod a+x /usr/local/bin/django-admin.py
[root@mail python]# django-admin.py startproject mysite
[root@mail python]# ll
total 4
drwxr-xr-x 3 root root 4096 Feb 14 10:34 mysite

这样就可以正常创建项目

你可能感兴趣的:(异常处理,django)