Network source-of-truth and infrastructure resource modeling (IRM) tool combining DCIM and IPAM. Built on Django + PostgreSQL + Redis.
docs/)netbox/ — Django project root; run all manage.py commands from herenetbox/netbox/ — Core settings, URLs, WSGI entrypointnetbox/<app>/ — Django apps: circuits, core, dcim, ipam, extras, tenancy, virtualization, wireless, users, vpndocs/ — MkDocs documentation sourcecontrib/ — Example configs (systemd, nginx, etc.) and other resourcespython -m venv ~/.venv/netbox
source ~/.venv/netbox/bin/activate
pip install -r requirements.txt
# Copy and configure
cp netbox/netbox/configuration.example.py netbox/netbox/configuration.py
# Edit configuration.py: set DATABASE, REDIS, SECRET_KEY, ALLOWED_HOSTS
cd netbox/
python manage.py migrate
python manage.py runserver
All commands run from the netbox/ subdirectory with venv active.
# Development server
python manage.py runserver
# Run full test suite
export NETBOX_CONFIGURATION=netbox.configuration_testing
python manage.py test
# Faster test runs (no DB rebuild, parallel)
python manage.py test --keepdb --parallel 4
# Migrations
python manage.py makemigrations
python manage.py migrate
# Shell
python manage.py nbshell # NetBox-enhanced shell
register_model_view() to register model views by action (e.g. "add", "list", etc.). List views typically don't need to add select_related() or prefetch_related() on their querysets: Prefetching is handled dynamically by the table class so that only relevant fields are prefetched.<app>/api/serializers.py; viewsets in <app>/api/views.py; URLs auto-registered in <app>/api/urls.py. REST API views typically don't need to add select_related() or prefetch_related() on their querysets: Prefetching is handled dynamically by the serializer so that only relevant fields are prefetched.<app>/graphql/types.py.<app>/filtersets.py — used for both UI filtering and API ?filter= params.django-tables2 used for all object list views (<app>/tables.py).netbox/templates/<app>/.<app>/tests/. Use netbox.configuration_testing for test config.created, last_updated fields (inherit from NetBoxModel where appropriate).url field (absolute URL of the object).FeatureQuery for generic relations (config contexts, custom fields, tags, etc.).ruff format on existing files, as this tends to introduce unnecessary style changes.manage.py makemigrations instead.<issue-number>-short-description (e.g., 1234-device-typerror)main branch for patch releases; feature tracks work for the upcoming minor/major release.configuration.py is gitignored — never commit it.manage.py lives in netbox/, NOT the repo root. Running from the wrong directory is a common mistake.NETBOX_CONFIGURATION env var controls which settings module loads; set to netbox.configuration_testing for tests.extras app is a catch-all for cross-cutting features (custom fields, tags, webhooks, scripts).docs/development/ for the full contributing guide and code style details.