Python 通过pip安装Django详细介绍
Python通过pip安装Django详细介绍
经过前面的Python包管理工具的学习,接下来我们就要基于前面的知识,来配置Django的开发与运行环境。
首先是安装Django(通过pip安装):
pipinstallDjango
输出的结果在我这里是这样的:
Downloading/unpackingDjango DownloadingDjango-1.5.2.tar.gz(8.0MB):8.0MBdownloaded Runningsetup.pyegg_infoforpackageDjango warning:nopreviously-includedfilesmatching'__pycache__'foundunderdirectory'*' warning:nopreviously-includedfilesmatching'*.py[co]'foundunderdirectory'*' Installingcollectedpackages:Django Runningsetup.pyinstallforDjango changingmodeofbuild/scripts-2.7/django-admin.pyfrom644to755 warning:nopreviously-includedfilesmatching'__pycache__'foundunderdirectory'*' warning:nopreviously-includedfilesmatching'*.py[co]'foundunderdirectory'*' changingmodeof/usr/local/bin/django-admin.pyto755 SuccessfullyinstalledDjango Cleaningup...
验证一下Django是否成功安装:
[root@nowamagic~]#python2.7 Python2.7.5(default,Sep22013,15:56:04) [GCC4.1.220080704(RedHat4.1.2-54)]onlinux2 Type"help","copyright","credits"or"license"formoreinformation. >>>importdjango >>>
import成功,也就是Django已经安装成功。
现在你去/usr/local/bin/中,也可以看到对应的django-admin.py了,这样就可以使用django-admin.py创建项目。
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!