Open
Conversation
Changes Made
1. Removed wagtailimportexport/ — the entire vendored package directory
2. Added wagtail-transfer==0.11 to requirements/base.txt
3. Replaced wagtailimportexport with wagtail_transfer in INSTALLED_APPS (openstax/settings/base.py)
4. Added wagtail-transfer settings to base.py — configurable via env vars:
- WAGTAILTRANSFER_SECRET_KEY — this instance's auth key
- WAGTAILTRANSFER_SOURCE_NAME / _URL / _KEY — defines the source to pull from
5. Added URL route wagtail-transfer/ in openstax/urls.py (above the catch-all wagtail route)
What's Needed Next
Per-environment setup:
On each environment, set these env vars:
# On production — pull from staging
WAGTAILTRANSFER_SECRET_KEY=<prod-secret>
WAGTAILTRANSFER_SOURCE_NAME=staging
WAGTAILTRANSFER_SOURCE_URL=https://staging.openstax.org/wagtail-transfer/
WAGTAILTRANSFER_SOURCE_KEY=<staging-secret>
# On staging — the secret key must match what prod uses as SOURCE_KEY
WAGTAILTRANSFER_SECRET_KEY=<staging-secret>
The SECRET_KEY on the source must match the SOURCE_KEY configured on the destination.
Run migrations on each environment:
python manage.py migrate wagtail_transfer
Permissions: Superusers get access automatically. For other users, create a group with the "Can import pages and
snippets from other sites" permission.
Usage: In Wagtail admin, there will be a new "Import" option. You browse the source environment's page tree and
select what to pull in — no more zip files.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR replaces the vendored wagtailimportexport page import/export implementation with the upstream wagtail-transfer package, wiring it into settings via environment variables and exposing the required transfer endpoint.
Changes:
- Remove the legacy
wagtailimportexportapp (code, templates, and tests). - Add
wagtail-transfer==0.11, enablewagtail_transferinINSTALLED_APPS, and add env-drivenWAGTAILTRANSFER_*settings. - Add the
wagtail-transfer/URL route ahead of the Wagtail catch-all route.
Reviewed changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
requirements/base.txt |
Adds the wagtail-transfer dependency needed for cross-environment imports. |
openstax/settings/base.py |
Swaps installed app to wagtail_transfer and adds env-configurable transfer secrets/sources. |
openstax/urls.py |
Exposes wagtail-transfer/ endpoints (before Wagtail’s catch-all). |
wagtailimportexport/admin_urls.py |
Removes legacy admin URL routing for the vendored tool. |
wagtailimportexport/apps.py |
Removes vendored app config. |
wagtailimportexport/config.py |
Removes vendored config. |
wagtailimportexport/exporting.py |
Removes legacy export implementation. |
wagtailimportexport/forms.py |
Removes legacy import/export forms. |
wagtailimportexport/functions.py |
Removes legacy helper utilities for zips/FKs/media. |
wagtailimportexport/importing.py |
Removes legacy import implementation. |
wagtailimportexport/templates/wagtailimportexport/index.html |
Removes legacy admin templates. |
wagtailimportexport/templates/wagtailimportexport/import-page.html |
Removes legacy admin templates. |
wagtailimportexport/templates/wagtailimportexport/export-page.html |
Removes legacy admin templates. |
wagtailimportexport/tests/test_functions.py |
Removes legacy tests. |
wagtailimportexport/tests/tests.py |
Removes legacy tests. |
wagtailimportexport/views.py |
Removes legacy views. |
wagtailimportexport/wagtail_hooks.py |
Removes legacy Wagtail admin hooks/menu item. |
wagtailimportexport/__init__.py |
Removes vendored package init. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes Made
- WAGTAILTRANSFER_SECRET_KEY — this instance's auth key
- WAGTAILTRANSFER_SOURCE_NAME / _URL / _KEY — defines the source to pull from
What's Needed Next
Per-environment setup:
On each environment, set these env vars:
On production — pull from staging
WAGTAILTRANSFER_SECRET_KEY=
WAGTAILTRANSFER_SOURCE_NAME=staging
WAGTAILTRANSFER_SOURCE_URL=https://staging.openstax.org/wagtail-transfer/
WAGTAILTRANSFER_SOURCE_KEY=
On staging — the secret key must match what prod uses as SOURCE_KEY
WAGTAILTRANSFER_SECRET_KEY=
The SECRET_KEY on the source must match the SOURCE_KEY configured on the destination.
Run migrations on each environment:
python manage.py migrate wagtail_transfer
Permissions: Superusers get access automatically. For other users, create a group with the "Can import pages and
snippets from other sites" permission.
Usage: In Wagtail admin, there will be a new "Import" option. You browse the source environment's page tree and
select what to pull in — no more zip files.