Skip to main content

wagtail-import-export

Page export from one Wagtail instance into another.

A published page and its published descendants can be exported via API or file from a source site and imported into a destination site under an existing page.

The destination site should have the same page models as the source site, with compatible migrations.

Installation

pip install wagtail-import-export

Now add to your project's INSTALLED_APPS:

INSTALLED_APPS = [
    # ...
    'wagtailimportexport',
    # ...
]

Add the following to your project's urls.py (note that the include(wagtailimportexport_urls) line must appear above the include(wagtail_urls) line that defines Wagtail's default routes):

from wagtailimportexport import urls as wagtailimportexport_urls

urlpatterns = [
    # ...
    url(r'', include(wagtailimportexport_urls)),
    url(r'', include(wagtail_urls)),
]

(wagtailimportexport.urls contains the export API endpoint. The admin urls are in wagtailimportexport.admin_urls and are automatically registered.)

You should now see an 'Import / Export' item in the Wagtail admin menu.

Configuration

When importing via the API, only published pages are exported by default. If a descendant page is unpublished it and all its descendants are pruned (even if some of those descendants are themselves published).

It is possible to export all pages under a source page by adding a setting on the source site:

WAGTAILIMPORTEXPORT_EXPORT_UNPUBLISHED = True

This should not be used in a public source site because the API is unauthenticated and would thus expose unpublished content to anyone.

Limitations

If the imported content includes any foreign keys to page models, these will be updated to reflect the new page IDs if the target page is also part of the import, or left unchanged otherwise. If the target page is neither part of the import nor does it already exist on the destination site, this is likely to fail with a database integrity error.

Page references within rich text or StreamField content will not be rewritten to reflect new page IDs.

Imports are processed in tree path order; first the base Page records are imported, followed by the data for specific page subclasses. If a model is imported which includes a foreign key to a specific subclass of Page, and the target page of that foreign key appears in the import but later in tree path order, this will fail with an integrity error (as the relevant record will not have been created at that point).

Non-page data, such as images, documents or snippets, is not included in the import; the user is responsible for ensuring that any objects referenced from imported pages are already present on the destination site (with matching IDs).

Metadata

Release files for wagtail-import-export 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wagtail-import-export 0.2
File Size Uploaded
wagtail-import-export-0.2.tar.gz 8.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wagtail-import-export 0.2
File Interpreter ABI Platform
wagtail_import_export-0.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 21.2 kB

Release files / wagtail-import-export-0.2.tar.gz

Download URL wagtail-import-export-0.2.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2a7219f7d09c4a70ff0f8d677476d3995ff89c681669c5cea819eba6c123ed16
BLAKE2b-256 checksum
How to use checksums
5d34e8b90b009f2d495760539c9ebb778de5655b5edfb5dd55885c665f3a6da7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.3

Release files / wagtail_import_export-0.2-py2.py3-none-any.whl

Download URL wagtail_import_export-0.2-py2.py3-none-any.whl
Size 12.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3e30e5dfc2ccec006402a9a69a191d07a18d59ab52e90d985d84074f4c8d1a65
BLAKE2b-256 checksum
How to use checksums
32d2295ad43836dec4b38f68aeec0d8547d94a817747eeb1ea3181103010094b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.7.3 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.6.3

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page