NetBox plugin for site diagrams with DWG/SVG support, floor levels, rack/device placement, and location geometry
Project description
netbox-dwg
A NetBox plugin that adds interactive floor-plan diagrams to your sites. Place racks and devices on a canvas backed by your own SVG/PNG floor plans, and keep the diagrams in sync with your NetBox inventory.
Screenshots
Features
- Floor levels per site — define multiple named floors (basement, ground, level 1 …) with numeric ordering
- Interactive canvas editor — drag-and-drop racks and devices from the site inventory onto a fabric.js canvas
- Read-only viewer — a clean view of each floor with optional rack/device highlighting (useful for linking from other NetBox objects)
- Background images — upload SVG, PNG, JPG, GIF, WebP, or BMP files, or point to an external image URL
- Automatic canvas sync — stale rack/device references are resolved (renamed) or removed (deleted) automatically every time a floor is opened
- Diagrams tab — a Diagrams tab is injected into the standard NetBox Site detail page listing all floors
- Default floor — mark one floor per site as the default so it opens first
- Canvas dimensions — set canvas width/height with selectable units (meters or feet)
- REST API — full CRUD endpoints for
FloorandDiagramImageat/api/plugins/dwg/
Requirements
| Requirement | Version |
|---|---|
| Python | ≥ 3.10 |
| NetBox | ≥ 4.0.0 |
Installation
From PyPI (recommended)
pip install netbox-dwg
From source
git clone https://github.com/ITW-Welding-AB/netbox-dwg.git
cd netbox-dwg
pip install .
Enable the plugin
Add the plugin to your NetBox configuration.py:
PLUGINS = [
"netbox_dwg",
]
PLUGINS_CONFIG = {
"netbox_dwg": {},
}
Apply database migrations
cd /opt/netbox
python netbox/manage.py migrate
Collect static files
python netbox/manage.py collectstatic --no-input
Restart NetBox and the NetBox worker after these steps.
Usage
Diagram images
Before creating floors you can pre-load background images:
- Navigate to Plugins → DWG → Diagram Images → Add
- Either upload a file or provide an external URL
- Give it a name — images are reusable across multiple floors
Floors
- Open any Site in NetBox and click the Diagrams tab
- Click Add Floor and fill in the name, level, optional background image, and canvas dimensions
- Click Edit on a floor to open the interactive canvas editor
- Use the Racks and Devices side panels to drag objects onto the canvas
- Save the canvas — the layout persists as JSON in the database
Reading the canvas
- Use the View button on a floor to open the read-only viewer
- Append
?highlight_type=rack&highlight_id=<id>(ordevice) to the view URL to highlight a specific object — handy for custom links in NetBox templates
REST API
The plugin registers endpoints under /api/plugins/dwg/:
| Endpoint | Methods | Description |
|---|---|---|
/api/plugins/dwg/floors/ |
GET, POST | List / create floors |
/api/plugins/dwg/floors/<id>/ |
GET, PUT, PATCH, DELETE | Retrieve / update / delete a floor |
/api/plugins/dwg/diagram-images/ |
GET, POST | List / create diagram images |
/api/plugins/dwg/diagram-images/<id>/ |
GET, PUT, PATCH, DELETE | Retrieve / update / delete an image |
Development
A Docker Compose environment is included for local development.
Prerequisites
- Docker and Docker Compose
Start the dev environment
docker compose up -d --build
NetBox will be available at http://localhost:8000.
Default credentials: admin / admin (created by the entrypoint).
The plugin source is volume-mounted into the container so changes to Python files (models, views, etc.) are picked up after a container restart, and changes to templates/static files are reflected immediately.
Running migrations inside the container
docker compose exec netbox python netbox/manage.py migrate
License
MIT © 2026 ITW Welding AB
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netbox_dwg-0.1.5.tar.gz.
File metadata
- Download URL: netbox_dwg-0.1.5.tar.gz
- Upload date:
- Size: 177.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
022f2fe677c735a346703c10c94fd7c1613be257311df9e28635a67c5c3f3ba7
|
|
| MD5 |
db432cee1b3396d8da9193c01383f293
|
|
| BLAKE2b-256 |
5259e27294bc6859954d477b31ee1cfe8b9a8bd6caef85b0dc55f778c9c5a4e7
|
Provenance
The following attestation bundles were made for netbox_dwg-0.1.5.tar.gz:
Publisher:
publish-to-pypi.yaml on ITW-Welding-AB/netbox-dwg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_dwg-0.1.5.tar.gz -
Subject digest:
022f2fe677c735a346703c10c94fd7c1613be257311df9e28635a67c5c3f3ba7 - Sigstore transparency entry: 1202683081
- Sigstore integration time:
-
Permalink:
ITW-Welding-AB/netbox-dwg@f3aa4acaec4a66216c9bc96463d54e65c81ceb42 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/ITW-Welding-AB
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yaml@f3aa4acaec4a66216c9bc96463d54e65c81ceb42 -
Trigger Event:
release
-
Statement type:
File details
Details for the file netbox_dwg-0.1.5-py3-none-any.whl.
File metadata
- Download URL: netbox_dwg-0.1.5-py3-none-any.whl
- Upload date:
- Size: 181.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbb638a6f0ff604e8f0c20bdd68ecf5f98f135b949edcdc8723d7a7a0f6ace99
|
|
| MD5 |
ccb0af67627855bd85f1d42c259fd8b5
|
|
| BLAKE2b-256 |
3f63a4beeb5b39d6a60866e300335581ec19a36ddb62fd82f7b5752cf59deb71
|
Provenance
The following attestation bundles were made for netbox_dwg-0.1.5-py3-none-any.whl:
Publisher:
publish-to-pypi.yaml on ITW-Welding-AB/netbox-dwg
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_dwg-0.1.5-py3-none-any.whl -
Subject digest:
fbb638a6f0ff604e8f0c20bdd68ecf5f98f135b949edcdc8723d7a7a0f6ace99 - Sigstore transparency entry: 1202683089
- Sigstore integration time:
-
Permalink:
ITW-Welding-AB/netbox-dwg@f3aa4acaec4a66216c9bc96463d54e65c81ceb42 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/ITW-Welding-AB
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yaml@f3aa4acaec4a66216c9bc96463d54e65c81ceb42 -
Trigger Event:
release
-
Statement type: