# Getting started with Django 5.2 LTS using uv

![Django 5.2 LTS · Python 3.14 · uv 0.13 · tested October 2026](https://cdn.hashnode.com/uploads/covers/5fdbaa361485f22e24b325e3/8e810e49-cc89-4c9e-89ea-5c1f52ad8b2c.png align="center")

> **Tested with:** uv 0.13.1, Python 3.14.8 and Django 5.2.18 LTS, October 2026. Django 5.2 is the current long-term-support release, with security fixes until April 2028.
> 
> Looking for my 2021 version with Django 3.2 and pipenv, which matches the CM3035 course videos? It's here: [Getting started with Django 3.2 (2021, pipenv)](https://pedbad.hashnode.dev/getting-started-with-django).

Back in 2021 I set up Django with pipenv. These days I use [**uv**](https://docs.astral.sh/uv/), a fast Python package and project manager. One tool now does what used to take three: it installs Python itself, creates an isolated environment for your project, and records the exact version of every package so anyone can rebuild the same set-up.

## Step 1: Install uv

On macOS or Linux:

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```

On Windows (PowerShell):

```powershell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```

If you use Homebrew, `brew install uv` also works. Open a new terminal, then check:

```bash
uv --version
```

## Step 2: Create a project

```bash
uv init --app --no-package mysite --python 3.14
cd mysite
```

This creates a `mysite` folder with:

*   `pyproject.toml`: your project's settings and its list of dependencies (like `package.json` in JavaScript, or the `Pipfile` in my old post);
    
*   `.python-version`: the Python version for this project (3.14);
    
*   `README.md`, a starter `main.py` (you can delete it) and a git repository.
    

If Python 3.14 isn't on your computer yet, uv downloads it for you. You don't need to install Python separately.

> **Why** `--no-package`**?** Since version 0.12, `uv init` sets projects up to be built as installable Python packages, in a `src/` folder. A Django site isn't a package, so `--no-package` keeps the simple layout Django expects.

## Step 3: Add Django

```bash
uv add "django>=5.2,<5.3"
```

The version range keeps you on the **5.2 LTS** series, so you get its security fixes but never jump to a new major version by accident. uv creates a `.venv` environment, installs Django into it, adds Django to `pyproject.toml`, and writes `uv.lock`, which records the exact version of every package (Django 5.2.18, asgiref, sqlparse).

## Step 4: Start the Django project

```bash
uv run django-admin startproject config .
```

The `.` at the end creates the project in the current folder instead of a new subfolder. You now have `manage.py` and a `config` folder holding `settings.py`, `urls.py`, `asgi.py` and `wsgi.py`.

`uv run` runs a command inside the project's environment. You don't need to activate the environment first, and it works the same on macOS, Linux and Windows.

## Step 5: Run it

```bash
uv run python manage.py migrate
uv run python manage.py runserver
```

Open http://127.0.0.1:8000/ and you should see Django's welcome page with the rocket. Press `Ctrl+C` to stop the server.

## Sharing your project (or rebuilding it on another computer)

Commit `pyproject.toml`, `uv.lock` and `.python-version` to git, but **not** `.venv`, which uv's `.gitignore` already leaves out. On another computer, after cloning:

```bash
uv sync
```

`uv sync` installs the right Python and the exact package versions from `uv.lock`. This is what pipenv's `Pipfile.lock` did, only much faster.

Other everyday commands:

| Task | Command |
| --- | --- |
| Add a package | `uv add djangorestframework` |
| Remove a package | `uv remove djangorestframework` |
| See what's installed | `uv tree` |
| Upgrade within your version range | `uv lock --upgrade-package django` then `uv sync` |

## Following the course instead?

The CM3035 course guide uses Python's built-in `venv` and `pip`. That works too. The equivalent of the steps above is:

```bash
python3 -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
python -m pip install "django>=5.2,<5.3"
django-admin startproject config .
python manage.py runserver
```

uv simply does the same with fewer steps and a lockfile.

## Resources

*   [uv documentation](https://docs.astral.sh/uv/)
    
*   [Django 5.2 documentation](https://docs.djangoproject.com/en/5.2/)
    
*   [Django supported versions](https://www.djangoproject.com/download/#supported-versions)
    
*   My older post: [Getting started with Django 3.2 (2021, pipenv)](https://pedbad.hashnode.dev/getting-started-with-django)
