Skip to main content

netbox-drawio

Draw network diagrams inside NetBox and link one diagram to many objects.

NetBox plugin for creating draw.io diagrams directly in NetBox and assigning them to multiple NetBox objects (Devices, Sites, Circuits, …).

A topology diagram usually touches many objects — unlike a per-object attachment, one Diagram here can be linked to every Device and Site it depicts.

Screenshots

The Diagrams tab on a Device, with SVG preview cards:

Diagrams tab on a Device detail page

The draw.io editor embedded in NetBox:

Embedded draw.io editor

Features

  • Embedded draw.io editor — edit diagrams in an iframe using the draw.io embed protocol. Diagram XML travels only between your browser and NetBox; the editor host never receives it.
  • Diagrams tab on object detail pages (like the Images feature) with SVG preview cards, per-card edit and unlink actions, and Add Diagram / Link Existing buttons.
  • Many-to-many assignment — link one diagram to any number of objects of any enabled type.
  • SVG previews served from a hardened endpoint (CSP, sandbox, nosniff; rendered via <img> so embedded scripts can never execute).
  • .drawio source download, REST API for diagrams and assignments, global search, change logging (content blobs are excluded; a content_hash records every content change), tags, custom fields, journaling, and object permissions.

Compatibility

NetBox Plugin
4.7.x ≥ 0.2.0
4.6.4 – 4.6.x 0.1.x

Python ≥ 3.12, < 3.15.

Installation

pip install netbox-drawio       # or: pip install -e /opt/drawio-netbox-plugin

configuration.py:

PLUGINS = [
    # ...
    "netbox_drawio",
]
python manage.py migrate netbox_drawio
python manage.py collectstatic --no-input
# restart NetBox services

Configuration

All settings are optional (PLUGINS_CONFIG["netbox_drawio"] = {...}):

Setting Default Description
drawio_base_url https://embed.diagrams.net/ Editor URL loaded in the iframe. Point it at a self-hosted draw.io for offline/private setups. Also used as the postMessage origin allowlist, so it must be an absolute http(s) URL (a system check warns otherwise, netbox_drawio.W001).
drawio_url_params {} Extra query params for the embed URL (ui, dark, libraries, lang, …). embed, proto and spin are always forced.
autosave False Persist draw.io autosave events (save on every change instead of explicit Save).
applied_scope model app or model — how scope_filter entries are interpreted (netbox-attachments semantics).
scope_filter [] Empty = every non-excluded model gets the Diagrams tab. Non-empty = allow-list, e.g. ["dcim", "circuits.circuit"].
excluded_apps Django/NetBox internals (auth, core, extras, users, …) Deny-list of app labels; always wins.
excluded_models [] Deny-list of app.model labels; always wins.
tab_weight 6500 Diagrams tab position (Images = 6000, Journal = 9000).
hide_empty_tab False Hide the tab when the object has no diagrams.
max_size 10485760 Max size in bytes for diagram XML and SVG, each. Django's DATA_UPLOAD_MAX_MEMORY_SIZE (2.5 MB by default) also caps the save request body — raise it to at least 3× max_size in the NetBox configuration or saves fail with a 413 well below this limit (a system check warns when max_size is unreachable, netbox_drawio.W002).

Self-hosted draw.io

PLUGINS_CONFIG = {
    "netbox_drawio": {
        "drawio_base_url": "https://drawio.example.com/",
        "drawio_url_params": {"ui": "min", "dark": "auto"},
    },
}

Usage

  1. From an object: open e.g. a Device → Diagrams tab → Add Diagram (creates the diagram already linked to the device) or Link Existing.
  2. Draw: on the diagram page click Edit Diagram — the embedded editor opens. Press the editor's Save button to store the XML and refresh the SVG preview. Exit returns to NetBox.
  3. Link more objects: diagram page → Assign to Object (or link from any object's tab). Unlinking never deletes the diagram.

REST API

  • /api/plugins/drawio/diagrams/ — CRUD incl. source_xml / svg_cache. The list response intentionally omits both blob fields (they can reach max_size per row); retrieve a diagram by id to get them. ?brief=true is unaffected.
  • /api/plugins/drawio/diagram-assignments/object_type as "app.model", e.g. {"diagram": 1, "object_type": "dcim.device", "object_id": 42}

Development

/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py test netbox_drawio --keepdb

Support

Bug reports and feature requests: GitHub Issues.

License

Apache-2.0 — see LICENSE. Copyright 2026 CESNET z.s.p.o.

Release files for netbox-drawio 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netbox-drawio 0.2.2
File Size Uploaded
netbox_drawio-0.2.2.tar.gz 45.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for netbox-drawio 0.2.2
File Interpreter ABI Platform
netbox_drawio-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 102.0 kB

Release files / netbox_drawio-0.2.2.tar.gz

Download URL netbox_drawio-0.2.2.tar.gz
Size 45.7 kB
Tags Source
SHA-256 checksum
How to use checksums
870b122c351358a9836bf6f8af4d8875415093a0e5f89f078acf6fa27d150245
BLAKE2b-256 checksum
How to use checksums
3573f90cdd1e7c18fb7ee5b33daa6d21204f3e4b2fb8cec8de4e72940c46ec37
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 Sep 11, 2026.

Transparency log

Release files / netbox_drawio-0.2.2-py3-none-any.whl

Download URL netbox_drawio-0.2.2-py3-none-any.whl
Size 56.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c783c581d89aa6c8102235cada141c97ab6a6fcf3c00ff6450fd2de18403b686
BLAKE2b-256 checksum
How to use checksums
a3654124340372692f3a5499b46bec8dc7a95acf476a17ba930633dd6d7e6861
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 Sep 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page