This is a development setup for the Wagtail Wordpress Import plugin. Wagtail Wordpress Import is a package for Wagtail CMS to import WordPress blog content from an XML file.
Run the following commands to install the developer setup.
# clone this repo
git clone https://github.com/nickmoreton/wwi-docker-develop
# change to the wwi-docker-develop directory
cd wwi-docker-develop
# install dependencies with poetry and run the setup
poetry shell
poetry install
./setup.shOnce you have followed the above steps, you will be able to access.
- Wagtail admin interface at http://[local-ip]:8000/admin
- WordPress admin interface at http://[local-ip]:8080/wp-admin
To manage the docker containers.
fab -lAll Commands
General
buildBuild the wagtail docker containerdestroyDestroy the docker containers. THIS WILL ALSO REMOVE - THE DATABASESinitInstall WordPress CLI and import the XML theme - fixures with media files (run this second)startStart the docker containersstartbuildBuild & Start the docker containersstopStop the docker containers
Wordpress
permalinksChange the WordPress permalink structure to /%postname%/run-importRun the import to WagtailthemeInstall a WordPress theme and switch to ittheme-deleteUn-install a WordPress theme by nametheme-installInstall a WordPress theme by namewpexportExport the WordPress data to an XML filewprestartRestart the WordPress containerwpstartStart the WordPress containerwpstopStop the WordPress container
Wagtail Wordpress Import / Django
shOpen a bash shell in the docker development containerrun-importRun the import to Wagtailrun-testsRun the tests for the Wagtail WordPress Impoterrun-deleteDelete all the imported pages. Optionally delete the images and documentsrun-del-documentsDelete all the imported documentsrun-del-imagesDelete all the imported images
After and initial setup running ./setup.sh the following fab commands are the most useful.
- start
- run-tests
- run-import (this will import the XML data again and only update existing pages)
- run-delete (run with the args
--imagesand/or--documents) - run-del-documents
- run-del-images
It can take a while for the WordPress site to be available at http://localhost:8080 Once running you should see the WordPress site populated with dummy blog posts and pages all with images and text content.
Using the fab commands you can swap out the WordPress theme and install a new one and export the XML data to a file. When you use that data file as the import source for your development the images and documents will be available locally via the runnning WordPress site. This is useful for develpment and testing the importer without having to download media etc. from a remote site.
You can login to the WordPress site at http://localhost:8080/wp-admin using the preset username/password of admin/password. If you want to change these login details look at the env.example file.
You can work with the WordPress site files: un-comment the lines indicated in the docker/docker-compose-wordpress.yml file. In theory, but not tested, you could add your own WordPress site files to the ./wordpress directory so you can work with your own data and media files.
Although this is done during setup you can run it again.
Run fab wpexport. An XML file named export.xml will be saved to the XML folder.