Get started

Perspectives

19 Mar 2025

Using uv for installing Wagtail

A Wagtail community member shares why they are loving uv

A close up photo of Raphael Stolt

Raphael Stolt

Polyglot Software Developer

An image with a quote from Raphael Stolt that says "coming from a strong PHP background where we had a tooling Renaissance with the introduction of Composer in 2013, it feels like uv is sparking the same for the Python community"

Recently I had the need to showcase the Wagtail admin interface to a bunch of editors. As I had uv, an extremely fast Python package and project manager, already installed on my Ubuntu development box, I was excited to to try pulling up a Wagtail instance via uv.

The following short guide describes how to install Wagtail via uv.

Installing uv and activating a virtual environment

In case uv isn't already installed on your system, it's just a simple curl or wget call away.

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

After uv has been installed you should set up a virtual environment and activate it. If you need, you can also set the Python version to use via the --python option of the uv venv command.

uv venv <optional-venv-name>
source .venv/bin/activate

Installing and running Wagtail

You can use the following bunch of commands to install, set up the Wagtail instance, and start the server which then allows access to the admin interface via http://127.0.0.1:8000/. Running these commands through uv ensures the virtual environment and defined Python version are used in an isolated manner.

uv pip install wagtail
uv run wagtail start <site-name>
cd <site-name>
uv pip install -r requirements.txt
uv run manage.py migrate
uv run manage.py createsuperuser
uv run manage.py runserver

Why uv?

For me, coming from a strong PHP background where we had a tooling Renaissance with the introduction of Composer in 2013, it feels like uv is sparking the same for the Python community. The installation of Wagtail and its dependencies felt very fast. Also, the management of virtual environments and Python interpreters got the DX (development experience) right. Even for package authors uv supports initialising projects. A virtual hat tip to Astral, the creators and maintainers of uv, for creating such an impressive tool.

Raphael Stolt is a polyglot software developer from Berlin, Germany who's into open source, music, and street art. You can what he has been tinkering with lately on his GitHub profile.