A development environment to development NetBox plugins. Provides a instance of NetBox and facilities to automatically set up the plugin within NetBox.
- Run
setup.shor clone netbox into ./netbox - Mark directory ./netbox/netbox as a source directory in PyCharm. This enables usage of imports in from netbox in PyCharm
- Set up your plugin now if this is a new project
- Build the docker container
- Configure .env with .env.example
- docker-compose.yml can now be used to launch the environment
Note: The container needs to be rebuilt on every change in
plugins/your_plugin/setup.py,netbox_config.pyorrequirements.txt.
- Update the files
plugins/plugin_template- Rename both directories
- Edit
setup.pyand__init__.pywith plugin details
- Add the plugin name to
netbox_config.py - Add any requirements for development in
requirements.txt(do not add requirements of your plugin, define those insetup.py)
NetBox plugins are Django modules. See the relevant documentation for Django modules for general purpose information. NetBox exposes specific modules for plugins. See here on how to use them: https://netbox.readthedocs.io/en/stable/plugins/development/