Wagtail in the News Room - Sævar Öfjörð Magnússon & Arnar Tumi Þorsteinsson
Published June 30, 2022
This video features Sævar Öfjörð Magnússon at Wagtail Space NL 2022 in Arnhem, Netherlands.
Sævar Öfjörð Magnússon explains how he built a template repository for starting Wagtail projects entirely in Docker. Wanting to keep his host computer free of Python and other project dependencies left him unable to create a normal project locally, so the template provides a Docker container in which he can create one. He clones the template, starts the container, opens a shell with `docker compose exec`, runs `wagtail start` and `manage.py migrate`, then restarts the container with the project’s normal process. The setup also lets users customize the port to avoid conflicts and leaves initial project creation under their control.
Summarised automatically from the transcript.
Docker lets you keep the host computer clean instead of installing and maintaining Python and project libraries on it. The speaker adopted this approach for client projects and wanted a reusable template to create projects without host dependencies.
Discussed at 0:02Create a repository from the template and clone it, then start the containers with `docker compose up`. Use `docker compose exec` to open a shell, run `wagtail start` in the project folder and apply migrations; then restart the container with the project’s normal process.
Discussed at 1:36Automatically transcribed, so expect mistakes in names and technical terms.
Originally I wanted to do a talk about how I would dock raise a an existing Wagtail project. The backstory is that like in January I got a new computer and we decided to move everything we had for clients. To Docker. So I want to maintain like a clean host computer without any libraries or Python stuff in it so I only use Docker to develop locally. So it turns out that I don't have an existing project on my computer like I couldn't create a base project on my computer because I don't have any of the dependencies.
So it was a kind of a cat's twenty two. So I flipped it so I will show you how I created a small template repository which will allow you to create a Docker Doc Rest Wagtail project in you know a few minutes. But first, this is a mess mistake many rookies do. They don't have the proper attire when working with docs. So you know. Okay, now I'm ready. Yeah, so I created a small template repository which you can use to
generate a product project. So I'm going to use this template I'm going to create a my Wagtail site. That's available. Create the repository from template So now I have the repository. I can clone the repository locally. So I will open up a terminal. Can you see this? No. Yeah. Okay. So I'll go to something like Code git clone repository. So what I would do here is just Docker compose
up Port already all located. Yeah, okay. So yeah, I run a lot of Dockers and some Sometimes they conflict. So I have this thing where I can customize the port. So what I do initially is I let the container run in kind of an infinite loop really. It's not doing anything at the moment because when you have an empty container, I didn't want to go the path of like doing everything for you in the beginning.
Because you want to control perhaps the name of your project and stuff like that. So I would just do a Docker compose exec Go into a shell and do a wagtail start my site in the current folder. I will I can do a manage migrate. So now I'm gonna stop the container again I'm going to switch it over to the correct process Run it again.
So here it is. Thank you.
June 15 - 17, 2022
Arnhem, Netherlands
Note: We understand that names change, people change, and bodies change. We respect each individual's journey and privacy. If you have any concerns about a video or need us to remove content, please don't hesitate to contact us. We will handle your request with care and promptly address any issues.
Published June 27, 2024
Published June 27, 2024
Published June 27, 2024
Published June 27, 2024
Published June 27, 2024
Published June 27, 2024