Install the backend#
Install collective.polls in a Plone site and confirm it works.
This guide covers the backend only. The frontend is a separate package and a separate guide: Install the frontend.
Requirements#
Plone |
6.2 |
Python |
3.10, 3.11, 3.12, 3.13, or 3.14 |
Frontend |
Volto 19. Polls have no Classic UI. |
Install the backend#
These steps are for a project generated by Cookieplone, which is the layout a Plone 6 project has.
Paths are relative to backend/, and <yourpackage> is the package under src/.
Declare the dependency in
pyproject.toml.dependencies = [ "Products.CMFPlone", "plone.api", "plone.restapi", "plone.volto", "collective.polls", ]
Load its ZCML, in
src/<yourpackage>/dependencies.zcml.<configure xmlns="http://namespaces.zope.org/zope"> <include package="collective.polls" /> </configure>
Your package's
configure.zcmlalready pulls that file in with<include file="dependencies.zcml" />. Installing the distribution is not enough on its own: without theinclude, nothing registers, and the add-on does not appear in the control panel.Install it with your own package, in
src/<yourpackage>/profiles/default/metadata.xml.<?xml version="1.0" encoding="utf-8"?> <metadata> <version>1000</version> <dependencies> <dependency>profile-collective.polls:default</dependency> </dependencies> </metadata>
Naming it here is what makes a fresh site arrive with polls, rather than waiting for somebody to remember the add-ons control panel. The profile depends on
plone.volto:default, and installs it when the site does not have it yet.Install the new dependencies, then restart the Plone instance.
make backend-install make backend-start
This is a ZCML change, so the site does not see the add-on until it restarts.
Note
To install into a site that already exists, without touching your package, use the Add-ons control panel, where the add-on is listed as collective.polls, and choose Install.
Verify#
A working install has all of these.
collective.polls under Installed in the Add-ons control panel.
Poll in the Add menu of a folderish page.
An answer from the
@pollservice on any poll, withGET <poll-url>/@poll.
The service answers 404 Not Found when the profile was not applied, because the services exist only with the add-on's browser layer.
Uninstalling#
Uninstalling removes the browser layer, which removes the @poll and @vote services.
It leaves every poll and its votes in place.
Next steps#
Install the frontend: the Volto add-on, without which polls cannot be shown or voted on.
Run your first poll: create, open, and close a poll.