Skip to main content

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

Floor plan editor

Floor plan viewer


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 Floor and DiagramImage at /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:

  1. Navigate to Plugins → DWG → Diagram Images → Add
  2. Either upload a file or provide an external URL
  3. Give it a name — images are reusable across multiple floors

Floors

  1. Open any Site in NetBox and click the Diagrams tab
  2. Click Add Floor and fill in the name, level, optional background image, and canvas dimensions
  3. Click Edit on a floor to open the interactive canvas editor
  4. Use the Racks and Devices side panels to drag objects onto the canvas
  5. 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> (or device) 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

netbox_dwg-0.1.5.tar.gz (177.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netbox_dwg-0.1.5-py3-none-any.whl (181.1 kB view details)

Uploaded Python 3

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

Hashes for netbox_dwg-0.1.5.tar.gz
Algorithm Hash digest
SHA256 022f2fe677c735a346703c10c94fd7c1613be257311df9e28635a67c5c3f3ba7
MD5 db432cee1b3396d8da9193c01383f293
BLAKE2b-256 5259e27294bc6859954d477b31ee1cfe8b9a8bd6caef85b0dc55f778c9c5a4e7

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for netbox_dwg-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 fbb638a6f0ff604e8f0c20bdd68ecf5f98f135b949edcdc8723d7a7a0f6ace99
MD5 ccb0af67627855bd85f1d42c259fd8b5
BLAKE2b-256 3f63a4beeb5b39d6a60866e300335581ec19a36ddb62fd82f7b5752cf59deb71

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page