Prepare the virtual environment: Python Development Virtual Environment
Pre-Installation Preparation1. Download Django:django DownloadThis article uses the django-1.5.9 (the difference between different versions is still relatively large, do not make a mistake)
2. Prepare the Django project directory: Define a directory yourself as the project directory
my own preparation is: ~/DJANGO15
3. About Virtual Environments3.1 Create
Mkvirtualenv DJANGO15
Automatically jumps to the virtual environment when createdYou can also manually enter a virtual environment:
Workon DJANGO15
The effect is the same
when your command-line prompt becomes similar to the following:
(DJANGO15) terminal_user> $
it means that the next operation is done in a virtual environment. # #当进入虚拟环境中后, it's much easier to operate, and it isolates the development environment (that is, the virtual environment) from the system environment, without "polluting" the system's Python environment!
Note# #接下来的安装操作没有特殊说明, all in a virtual environment# #虚拟环境中, the previous commands on Linux are fully applicable! namely: CD, LS and other commands are fully applicableInstalling DjangoDecompression django-1.5.9.tar.gzEnter django-1.5.9 Execution:
Python setup.py Install
Django is installed, and you can see that Django is installed in a virtual environment.
to the project directory you created earlier, that is:~/django15 Create a project, you can also call the site:
django-admin.py Startproject MySite
A MySite site is created here.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Django (a)---install Django