Skip to content

Running the Plone 5 EDRN Portal in Development

Sean Kelly edited this page Apr 17, 2019 · 1 revision

This document describes how to get the Plone-5–based portal for the Early Detection Research Network working in your local development environment. Currently, the portal is now based on Plone 5.1.5 and is kept in a separate Github repository due to the fact that the Plone-4–based portal uses plone.app.ldap, which cannot be uninstalled (and we therefore have to start with a clean, empty Zope database).

Prerequisites

Your development environment will need the following tools and libraries pre-installed (if a choice is offered by your operating system, choose the "development" version of a package so that you'll have development-compatible libraries and headers):

In addition, these instructions assume a Unix-compatible environment such as macOS, Linux, FreeBSD, and so forth.

Buildout Cache

To save time between builds, you may want to prepare your ~/.buildout directory in order to cache Python eggs, downloads, and Buildout extensions between builds. To do so:

  1. mkdir ~/.buildout
  2. mkdir ~/.buildout/{eggs,downloads,extends}

Then create ~/.buildout/default.cfg with the following contents:

[buildout]  
eggs-directory = /home/NAME/.buildout/eggs  
download-cache = /home/NAME/.buildout/downloads  
extends-cache = /home/NAME/.buildout/extends 

Substitute the path to your home directory as needed.

You may also need an installation of Python 2.7. Many operating systems come with Python 2 pre-installed. The one supplied in the latest version of macOS may work; if not, consider using the Python@2 package provided by Brew.

Regardless of which Python you use, you may need to install a slightly older version of setuptools in a virtualenv in order to avoid issues by running:

pip install setuptools==38.5.1

This may not be necessary as of the time of this writing as pip releases occur rapidly and frequently and the issue experienced by this writer may be resolved by now. (Do not do this to your system Python! Use a virtualenv.)

Structure of the Plone 5 EDRN Portal

For those familiar with the Plone 2-, 3-, and 4-versions of the EDRN Portal, you are no doubt familiar with a single Buildout which then used separate Python components as either downloaded eggs or development eggs in the "src" directory. This required a Git repository for each egg plus the unifying Buildout which brought them all together and was needlessly complex, especially given the power of Git to do sophisticated branches.

With Plone 5, a single Git repository holds the Buildout along with all of the component eggs. Clone this buildout from Github using either the SSH or HTTPS addresses provided at that site.

Building in Development Mode

To then build the Plone-5–based EDRN portal in your local development environment, do the following:

  1. Clone the Github repository as mentioned above and make P5 the current working directory.
  2. Use the Python with the "pip" installation described above to bootstrap by running: python2.7 bootstrap.py -c dev.cfg
  3. Build out by running: bin/buildout -c dev.cfg

You can then start the portal by running bin/zope-debug fg and visit http://localhost:6468 with a browser. Once there, click "Advanced" and check the box by "edrnsite.policy" then click "Create Plone Site". You can then visit http://localhost:6468/edrn to see the new EDRN portal.

If you ever need to start over, simply stop "bin/zope-debug" (usually with CTRL+C) and erase all files in var/filestorage, then re-buildout and re-run "bin/zope-debug fg".