@@ -5,11 +5,10 @@ How to install Django on Windows
5
5
.. highlight:: doscon
6
6
7
7
This document will guide you through installing Python 3.7 and Django on
8
- Windows. It also provides instructions for installing `virtualenv`_ and
9
- `virtualenvwrapper`_, which make it easier to work on Python projects. This is
10
- meant as a beginner's guide for users working on Django projects and does not
11
- reflect how Django should be installed when developing patches for Django
12
- itself.
8
+ Windows. It also provides instructions for setting up a virtual environment,
9
+ which makes it easier to work on Python projects. This is meant as a beginner's
10
+ guide for users working on Django projects and does not reflect how Django
11
+ should be installed when developing patches for Django itself.
13
12
14
13
The steps in this guide have been tested with Windows 7, 8, and 10. In other
15
14
versions, the steps would be similar. You will need to be familiar with using
@@ -49,30 +48,34 @@ get-pip.py`` instructions.
49
48
50
49
.. _pip: https://pypi.org/project/pip/
51
50
52
- .. _virtualenvwrapper-win :
51
+ .. _virtualenvironment :
53
52
54
- Install ``virtualenv`` and ``virtualenvwrapper``
55
- ================================================
53
+ Setting up a virtual environment
54
+ ================================
56
55
57
- `virtualenv`_ and `virtualenvwrapper`_ provide a dedicated environment for
58
- each Django project you create. While not mandatory, this is considered a best
59
- practice and will save you time in the future when you're ready to deploy your
60
- project. To do this, run::
56
+ It is best practice to provide a dedicated environment for each Django project
57
+ you create. There are many options to manage environments and packages within
58
+ the Python ecosystem, some of which are recommended in the `Python
59
+ documentation <https://packaging.python.org/guides/tool-recommendations/>`_.
60
+ Python itself comes with `venv`_ for managing environments which we will use
61
+ for this guide.
61
62
62
- ...\> py -m pip install virtualenvwrapper-win
63
+ To create a virtual environment for your project, open a new command prompt,
64
+ navigate to the folder where you want to create your project and then enter the
65
+ following::
63
66
64
- Then create a virtual environment for your project::
67
+ ...\> py -m venv project-name
65
68
66
- ...\> mkvirtualenv myproject
69
+ This will create a folder called 'project-name' if it does not already exist
70
+ and setup the virtual environment. To activate the environment, run::
67
71
68
- The virtual environment will be activated automatically and you'll see
69
- "(myproject)" next to the command prompt to designate that. If you start a new
70
- command prompt, you'll need to activate the environment again using::
72
+ ...\> project-name\Scripts\activate.bat
71
73
72
- ...\> workon myproject
74
+ The virtual environment will be activated and you'll see "(project-name)" next
75
+ to the command prompt to designate that. Each time you start a new command
76
+ prompt, you'll need to activate the environment again.
73
77
74
- .. _virtualenv: https://pypi.org/project/virtualenv/
75
- .. _virtualenvwrapper: https://pypi.org/project/virtualenvwrapper-win/
78
+ .. _venv: https://docs.python.org/3/tutorial/venv.html
76
79
77
80
Install Django
78
81
==============
0 commit comments