7. Installing Plone for the Training#

We install the Plone backend and its React-based frontend Volto. This starts with the following folder structure:

training
├── backend
└── frontend

In backend we install Plone and add our custom Python code. In frontend we install Volto and add our custom React code.

7.1. Installing the backend#

We encourage you to install and run Plone on your own machine, as you will have important benefits:

  • You can work with your favorite editor.

  • You have all the code of Plone at your fingertips in site-packages tree.

  • TODO Find out the original intention of the following sentence: "You do not have to switch between different operating systems during the training."

7.1.1. Prerequisites#

Please see official installation instructions.

7.1.2. Installation#

Set up Plone with the training code: ploneconf.site add-on and training.votable add-on.

mkdir training
cd training
git clone https://github.com/collective/training_buildout.git backend
cd backend

Until Mastering Plone 6 version is released, please checkout the branch plone6.

git checkout plone6

Create a Python virtual environment. Install prerequisites. Run mxdev to be prepared to install Plone packages with pip.

python -m venv venv
source venv/bin/activate
pip install -U pip wheel mxdev
mxdev -c mx.ini

For more info about the fancy tool mxdev, see official installation instructions.

Install your Plone packages, core and add-ons:

pip install -r requirements-mxdev.txt

Generate your Zope configuration with cookiecutter. This is also necessary after changes of instance.yaml.

cookiecutter -f --no-input --config-file instance.yaml https://github.com/plone/cookiecutter-zope-instance

Run Zope:

runwsgi instance/etc/zope.ini

Voilà, your Plone is up and running on http://localhost:8080.

Note

Troubleshooting

If you encounter bug "The 'Paste' distribution was not found and is required by the application": Be sure that you have activated your virtual Python environment and are running its runwsgi and not another one.

source venv/bin/activate
runwsgi instance/etc/zope.ini

The output should be similar to:

me@here backend % runwsgi instance/etc/zope.ini
2022-08-24 00:45:39,083 INFO    [Zope:42][MainThread] Ready to handle requests
Starting server in PID 93572.
2022-08-24 00:45:39,085 INFO    [waitress:486][MainThread] Serving on http://[::1]:8080
2022-08-24 00:45:39,085 INFO    [waitress:486][MainThread] Serving on http://127.0.0.1:8080

Point your browser to http://localhost:8080 to see Plone running.

Plone is running.

Plone, up and running.#

There is no Plone site yet. We will create one in the next chapter.

You can stop the running instance anytime using ctrl + c.

Ready to create a `Plone` instance.

Ready to create a Plone instance#

7.2. Installing the frontend#

You have two options:

  1. Create the frontend from scratch using the Volto generator.

  2. Use the existing Volto project for this training volto-ploneconf with all the code for the training.

7.2.1. Option 1: Frontend from scratch with Volto generator#

Installing Plone frontend

7.2.2. Option 2. Start with existing training project volto-ploneconf with all code for the training#

Prepare the pre-requisites.

Get the finished code for the frontend from github and install:

git clone https://github.com/collective/volto-ploneconf.git frontend
cd frontend
yarn

Now you can start the app with:

$ yarn start

Create a Plone site object Plone on http://localhost:8080

Point your browser to http://localhost:3000 and see that Plone is up and running.

You can stop the frontend anytime using ctrl + c.