django installation (Linux)

1. Create a virtual environment
A virtual environment keeps the coding environment on your computer neat and tidy. Virtual environments isolate your Python/django installations on a project-by-project basis. Your changes to one website will not affect other developed websites.
(Terminal) Create a new directory djangogirls under the home directory and move into that directory:

mkdir djangogirls
cd djangogirls

 (Terminal) Create a virtual environment myvenv, command:

python3 -m venv myvenv

 2. Use a virtual environment

(Terminal) Enter the following command (replace myvenv with the name of your virtual environment):

~/djangogirls$ source myvenv/bin/activate

 When the (myvenv) prefix appears, you are already in the virtual environment.

3. Install django

django can be installed with pip in a virtual environment. Enter the following command in the terminal:

pip install django==1.8

 Use a double equals sign followed by the version of django you want to install.

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326925053&siteId=291194637