> For the complete documentation index, see [llms.txt](https://sathyakumars-kb.gitbook.io/user-authentication-based-django-app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sathyakumars-kb.gitbook.io/user-authentication-based-django-app/basic-python-virtual-environment-setup.md).

# Basic Python Virtual Environment Setup

1. Choose code editor platform like Visual Studio(recommending), Sublime Text, PyCharm, Atom or Vim.&#x20;
2. Install Python 3.10 (at least)&#x20;
3. Set the Environment Path for python interpreter.
4. Create a Folder name "Djnago Todo App with User Authentcation"
5. Open created folder "Djnago Todo App with User Authentcation" in visual studio code.
6. Open Terminal in vs code (ctrl + \`) and change terminal from from powershell to cmd like given below (ref Fig. 1.1)

<figure><img src="/files/nPbsIFTQXO14izrDhknp" alt=""><figcaption><p>Fig 1.1 Terminal in cmd </p></figcaption></figure>

7. using python to create a virtual environment for your project namely "pyvenv"

Type below code in your cmd prompt (ref Fig. 1.2)

```
py -m venv pyvenv
```

<figure><img src="/files/JHqMA73g27jKsHQDocSR" alt=""><figcaption><p>Fig. 1.2 Python Virtual Environment </p></figcaption></figure>

8. Now activate your python virtual environment in terminal.

Type below code in your cmd prompt (ref Fig. 1.3)

```
call pyvenv/Scripts/activate
```

<figure><img src="/files/I6IhkuveT503klYNZJJI" alt=""><figcaption><p>Fig. 1.3 Activating python virtual environment.</p></figcaption></figure>

9. Create "requirements.txt" file in "Djnago Todo App with User Authentcation" folder. (ref Fig. 1.5)

<figure><img src="/files/O7zEGE4p35uUuNwmsOFJ" alt=""><figcaption><p>Fig. 1.4 Creating requirements.txt in root folder.</p></figcaption></figure>

10. Save the below lines in requirements.txt file.

```pip-requirements
asgiref==3.7.2
Django==4.2.9
sqlparse==0.4.4
tzdata==2023.4
```

<figure><img src="/files/4i2pMMq2dKTHDuLwYJJf" alt=""><figcaption><p>Fig. 1.5 Collecting Requirements</p></figcaption></figure>

11. Install the requirements.txt using python package manager (pip) in your virtual environment (pyvenv)

Type below code in your cmd prompt (ref Fig. 1.6)

<pre><code><strong>pip install -r requirements.txt
</strong></code></pre>

<figure><img src="/files/HbESuXbQ2cWOyxB1UBL3" alt=""><figcaption><p>Fig. 1.6 Installing Requirements.</p></figcaption></figure>

12. Now check the requirements are successfully installed.

Type below code in your cmd prompt (ref Fig. 1.7)

```
pip freeze
```

<figure><img src="/files/HZmtgIy7WfZWsrlr2vSe" alt=""><figcaption><p>Fig. 1.7 Checking Requirements in pyvenv</p></figcaption></figure>
