Skip to content

Commit 922ff51

Browse files
authored
Fixed #31628 -- Updated Windows install guide to recommend venv.
1 parent d693a08 commit 922ff51

File tree

2 files changed

+24
-28
lines changed

2 files changed

+24
-28
lines changed

docs/howto/windows.txt

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ How to install Django on Windows
55
.. highlight:: doscon
66

77
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.
1312

1413
The steps in this guide have been tested with Windows 7, 8, and 10. In other
1514
versions, the steps would be similar. You will need to be familiar with using
@@ -49,30 +48,34 @@ get-pip.py`` instructions.
4948

5049
.. _pip: https://pypi.org/project/pip/
5150

52-
.. _virtualenvwrapper-win:
51+
.. _virtualenvironment:
5352

54-
Install ``virtualenv`` and ``virtualenvwrapper``
55-
================================================
53+
Setting up a virtual environment
54+
================================
5655

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.
6162

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::
6366

64-
Then create a virtual environment for your project::
67+
...\> py -m venv project-name
6568

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::
6771

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
7173

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.
7377

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
7679

7780
Install Django
7881
==============

docs/intro/contributing.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,6 @@ more convenient.
163163

164164
...\> %HOMEPATH%\.virtualenvs\djangodev\Scripts\activate.bat
165165

166-
or you can install :ref:`a Windows version of virtualenvwrapper
167-
<virtualenvwrapper-win>` and then use:
168-
169-
.. code-block:: doscon
170-
171-
...\> workon djangodev
172-
173166
__ https://virtualenvwrapper.readthedocs.io/en/latest/
174167

175168
The name of the currently activated virtual environment is displayed on the

0 commit comments

Comments
 (0)