7. Package an addon (deployment)¶

    As noted previously, when addons are installed into projects from the ControlPanel, they can expose their settings to the user via a web form in the file.

    We’ll add a checkbox field, to control whether the user wants the Debug Toolbarto be active or not. The value of the new enable_debug_toolbar field willbe passed to the to_settings() method, in the data dictionary. Thenwe’ll also test for before enabling theToolbar:

    We can’t actually test this locally - we’ll have to upload it before we can dothat.

    The addon needs a LICENSE, so download that from the Control Panel and moveit to the package.

    The final packaging file is specific to the Divio Cloud, , whichprovides some additional metadata:

    Download it and add it to the addon.

    Make sure you’re in the addons-dev/tutorial-django-debug-toolbar directory.

    Now, running divio addon validate should now confirm that the addon isvalid:

    Don’t worry about the warnings - as long as there are no errors, all is inorder.

    As the output notes, this version of the addon has been placed into the Alpha_release channel. If you visit the its _Versions page, you’ll be able to changethe release channel.

    If you now visit your project (or any project you have access to) in theControl Panel, and select its Addons menu, you’ll be able to select, installand configure your new addon, complete with the checkbox field you createdearlier.

    If you deploy your Stage server, you’ll have the Debug Toolbar running in thecloud project.

    You can manage your addon, moving particular versions of it into the Beta orStable channels, make it public and so on.