Getting Django up and running inside a virtual environment is a breeze! Here’s a step-by-step guide for you:
### Step 1: Install `virtualenv`
First, ensure you have `virtualenv` installed. You can do this using `pip`:
```bash
pip install virtualenv
```
### Step 2: Create a Virtual Environment
Navigate to the directory where you want to set up your Django project and create a virtual environment. Let’s call it `myenv`:
```bash
virtualenv myenv
```
### Step 3: Activate the Virtual Environment
Activate your virtual environment. The command varies slightly depending on your operating system:
- **Windows:**
```bash
myenv\Scripts\activate
```
- **macOS and Linux:**
```bash
source myenv/bin/activate
```
### Step 4: Install Django
With the virtual environment activated, you can now install Django. Run:
```bash
pip install django
```
### Step 5: Verify the Installation
To confirm that Django has been installed successfully, you can check the version:
```bash
django-admin –version
```
And that’s it! You’re all set to start building your Django project within the virtual environment. If you need help with anything else, feel free to ask!