New Wagtail Course! 🥳 The Ultimate Wagtail Developers Course

Upgrading From Wagtail 2.5 to Wagtail 2.7 LTS

Upgrading from Wagtail 2.5 to Wagtail 2.7 LTS


### Advancing to Wagtail 2.7 LTS As you move to Wagtail 2.7 LTS, it’s crucial to address any arising issues by consulting the official [Wagtail releases documentation]( This resource is invaluable for troubleshooting and understanding the specifics of what each version entails. ### Update Your Requirements Make sure your `requirements.txt` reflects the new version: ```plaintext wagtail==2.7 ``` ### Handling Docker Environments 🐳 If you're using Docker or any robust caching mechanism, remember to rebuild your containers whenever you upgrade significant components like Wagtail. This step ensures that all parts of your environment are up-to-date and can communicate effectively without legacy issues. 🛠 **Rebuild Command:** You might typically use commands like: ```bash docker-compose down docker-compose build docker-compose up ``` These commands ensure that your environment is clean and reflective of the new changes in your setup. ### Encountering and Resolving Errors During the upgrade, you might encounter errors such as: ```plaintext from wagtail.contrib.forms.models import AbstractFormField ``` If you see this after upgrading within a Docker container, it’s a sign you need to rebuild the container to integrate the new Wagtail 2.7 version fully. ### Streamlining the Admin UI With the major visual updates in Wagtail from versions 2.5 to 6.0, it's a good time to consider simplifying your UI customization. This might mean removing packages like `wagtail-uplift` and custom CSS that no longer align with the updated admin interface: ```python from wagtail.core import hooks @hooks.register('insert_global_admin_css') def global_admin_css(): return format_html('<link rel="stylesheet" href="{}">', static('path/to/theme.css')) ``` 🚨 **CAUTION:** Before you strip out custom CSS, review it! Some tweaks, especially those related to components like the rich text editor, might still be beneficial and worth keeping.

Kalob Taulien

Wagtail CMS enthusiast; Wagtail core team member; Coding teacher.

Get notified about new Wagtail content.