508   Django Python

Django是一个用Python写的Web框架,打包成一个Python包,非常便于引用和搭建Web项目

先来看看怎么安装Django这个python包吧

 

1,首选确保centos6安装了python环境

 

# python
Python 2.7.6 (default, Jan 12 2017, 17:51:36) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

centos6默认是python2.6的,由于Django目前1.10版本只支持python2.7以上,所以建议升级到python,具体方法参考这里

 

2,然后安装python包管理工具pip,以后肯定会用到

 

yum install python-pip

 

3,最后通过pip安装Django

 

pip install Django 

 

4,测试

 

>>> import django
>>> print(django.get_version())
1.10

 

说明成功安装Django了,接下来就看怎么用这个python web框架啦




Leave a Reply

Your email address will not be published. Required fields are marked *