Install Django

Posted rysly

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Install Django相关的知识,希望对你有一定的参考价值。

https://docs.djangoproject.com/en/1.10/intro/tutorial01/
http://www.aichengxu.com/view/42213

 

1.first install python


2.install Django

pip install Django==1.10.4
======
python
>>> import django
>>> print(django.get_version())
1.10.4
=====or======
python -m django --version
1.10.4
======

 

3.create a project
$ django-admin startproject mysite

//此时出现一些问题,说明还是没有安装好django,解决方法是:
建立虚拟环境,在虚拟环境下安装django,

at this point,there are some problems that django is not installed successfully,slove as follows:
1.install virtual environment
2.install django in a virtual environment

 


4.install virtualenv(creat a virtual env)
$ pip install virtualenv
$ virtualenv --version
$ virtualenv venv
$ source venv/bin/activate
$ deactivate //jump out of the virtual env

5.此时执行
pip install django
django-admin.py --help //mean the installation is successful
现在可以敲写这行命令来建一个project了:
now you can type the command line for creating a project
$ django-admin startproject mysite

以上是关于Install Django的主要内容,如果未能解决你的问题,请参考以下文章

install命令

Mac Brew install

Vue.use() 与 install()

install命令的用法

install cmake,install torch7

pip install PIL报错问题解决