NetBox Labels
A NetBox plugin that generates scannable QR code labels for your objects (devices, racks, cables, sites, tenants, IP addresses, ...) from admin-defined HTML/CSS/JS templates, with a no-code visual designer and printing support for both direct label printers and regular printers.
- Repository: https://github.com/N34AY/netbox-labels
- Issues / bug reports / feature requests: https://github.com/N34AY/netbox-labels/issues
- Docs: https://n34ay.github.io/netbox-labels/ — also readable as plain Markdown under docs/ here on GitHub, or via the "Model Documentation" link on a Label Template's or Label Size Preset's page in a running NetBox instance
Features
- Visual template designer — drag/resize text, image, and QR elements on a canvas sized to your label (mm), no HTML/CSS required. Undo/redo, zoom, and reusable size presets.
- Code editor — for anyone who prefers to write the HTML/CSS/JS by hand, or fine-tune what the designer generated.
- Per-object-type templates — a template can apply to one, several, or all object types, and every applicable template is offered on that object's detail page.
- Live preview — against placeholder data or a real object, before saving.
- Single-object printing — print any object's label via the browser's print dialog, or directly to a label printer (see below).
- Bulk printing — select any number of objects on a list page, pick a template, and print them all in one batch: either combined onto as few standard-size sheets as possible (A4/A5/ Letter/Legal, via the browser's print dialog) or one-by-one to a direct label printer, with per-object progress tracking and resume-on-failure (e.g. if the printer runs out of paper mid-batch).
- Direct label-printer support — Niimbot, Zebra (ZPL), and generic ESC/POS printers, over Bluetooth or USB, straight from the browser via the Web Bluetooth / Web Serial APIs. No server-side printer drivers or agents required.
- Ukrainian localization included out of the box (
uk), alongside the default English.
Requirements
- NetBox >= 4.5
- Python >= 3.12
- A Chromium-based browser (Chrome, Edge) for direct label-printer support — Web Bluetooth and Web Serial aren't implemented by Firefox or Safari. Everything else (templates, designer, browser-print bulk printing) works in any modern browser.
Installation
-
Install the package into NetBox's Python environment:
# From GitHub, latest main: pip install git+https://github.com/N34AY/netbox-labels.git # Or pin a specific ref: pip install git+https://github.com/N34AY/netbox-labels.git@<tag-or-commit>
If you're running NetBox via the official netbox-docker image, add the line above to your
plugin_requirements.txt(or build a custom image that installs it) rather than runningpip installinside the container directly, so it survives container recreation. -
Enable the plugin in NetBox's
configuration.py:PLUGINS = [ "netbox_labels", ] PLUGINS_CONFIG = { "netbox_labels": {}, }
-
Run migrations and collect static files:
python manage.py migrate netbox_labels python manage.py collectstatic --no-input
-
Restart NetBox (and its RQ worker, if running as a separate process).
Configuration
Once installed, admin-level settings (e.g. whether to offer direct label-printer printing at
all) live in-app under Plugins → Labels → Settings, not in configuration.py — no
further static configuration is required beyond the PLUGINS/PLUGINS_CONFIG entries above.
Getting started
- Go to Labels → Templates in the sidebar and create a template, or use the visual designer (the palette icon next to a template) to build one without writing code.
- Pick which object type(s) it applies to (or "apply to all").
- Open any matching object's detail page — a Labels panel appears with every applicable template, ready to view/print.
- To print many objects at once, select their checkboxes on that object type's list page and use the Bulk print labels button that appears in the selection toolbar.
Template context
Templates are Jinja2 + HTML. When rendered for a specific object, the following is available:
- In the
HTMLandQR code valuefields (Jinja2):{{ object }}— the model instance (e.g. aDevice){{ object_type }}— itsContentType{{ object_url }}— absolute URL to the object's NetBox detail page, or the Custom object URL template configured under Labels → Settings, if set (e.g. to point QR codes at a shorter external URL and ease scanning){{ object_data }}— the object serialized the same way the REST API would
- In JavaScript, once the page loads:
window.NetBoxQR.value— the rendered QR code valuewindow.NetBoxQR.objectData— the sameobject_data, as JSON- Any
<div data-netbox-qr></div>in the template's HTML is automatically filled with a scannable QR code (via a bundled QR library — no external network requests).
Object data interpolated into the HTML template is HTML-escaped automatically, so it's safe to bind a template to fields your users (not just template authors) can edit.
Trust model
html_code/css_code/js_code are rendered and executed as-is — the same trust model
NetBox itself uses for Export Templates and Custom Links. Only users with
netbox_labels.add_qrtemplate / change_qrtemplate permission can author or edit templates, so
that permission should be granted only to trusted staff, the same as NetBox's own scripting
and export-template features.
Running tests
Like any NetBox plugin, the test suite needs a full NetBox environment (it exercises real
dcim models and the plugin's own migrations), so it's run through NetBox's own management
command rather than directly with pytest:
python manage.py test netbox_labels
From inside the netbox-docker netbox container, that's:
docker compose exec netbox python /opt/netbox/netbox/manage.py test netbox_labels
The static JS assets (the visual designer, bulk printing, printer drivers) have their own suite, run with Jest:
npm install
npm test
Contributing
Issues and pull requests are welcome at github.com/N34AY/netbox-labels. Please include your NetBox and plugin version when reporting a bug. See CONTRIBUTING.md for dev setup and how to run the test suites.
Found a security issue? Please see SECURITY.md instead of opening a public issue.
License
Apache License 2.0 — see LICENSE.
Metadata
Release files for netbox-labels 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| netbox_labels-0.5.0.tar.gz | 1.5 MB | With provenance | Details for netbox_labels-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| netbox_labels-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for netbox_labels-0.5.0-py3-none-any.whl |
Total release size: 3.1 MB
Release files / netbox_labels-0.5.0.tar.gz
| Download URL | netbox_labels-0.5.0.tar.gz |
|---|---|
| Size | 1.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c07a03faca87304f382da47eac5cae666bd14bdf8d1fc8a7753ce8d6e308108
|
|
BLAKE2b-256 checksum How to use checksums |
4509cf6bbfc36d62923c3e62dd0d067bc27097677de7851aed88ecf0f0421234
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.
Transparency logRelease files / netbox_labels-0.5.0-py3-none-any.whl
| Download URL | netbox_labels-0.5.0-py3-none-any.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3d11319b369394c34822d7d6f3ed99cdb01dc090b8fdce3912515895702c9608
|
|
BLAKE2b-256 checksum How to use checksums |
8c14bba440a413d29d06ca91da2506f6a72590bfbdf6086948678193bff518cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.
Transparency logSecurity for netbox-labels 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for netbox_labels-0.5.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.