Skip to content

Your First Sign-in

Outcome: NetBox's sign-in page answering in a browser-shaped way, and an administrator signed in to an empty home page. Chapter 3 built the install; this chapter starts it and proves the door works before anything is recorded in it.

Starting the server

For a first run — and only a first run — Django's built-in development server is the honest tool:

cd netbox
../venv/bin/python manage.py runserver 127.0.0.1:18080 --noreload

The address and port are the lab's; the shape of the command is what matters. The development server is a lab and learning instrument, not a deployment: a real install puts a production server (gunicorn, which NetBox's requirements already include) behind a web server such as nginx — taught from the documentation here, not run.

The check: the door answers

With nothing signed in, the root of the site does not show a home page; it sends you to the sign-in page, and the sign-in page answers:

GET /        -> 302 redirect to /login/?next=/
GET /login/  -> 200
<title>Home | NetBox</title>

(Transcript t06-web-server-and-login.txt.) The API root makes the same point in its own dialect — no credentials, no records:

GET /api/ -> 403
{"detail":"Authentication credentials were not provided."}

That refusal is a feature working: an unread map stays unread.

Signing in, for real

The lab signed in the way a browser does — fetched the sign-in page, took its CSRF token (the anti-forgery value every Django form carries), posted the administrator name and password from chapter 3, and followed the answer:

POST /login/ -> 302 redirect to /
GET / with session -> 200

(Transcript t09-ui-login-and-refusals.txt.) Signed in, the home page of an empty NetBox is mostly a set of counters at zero and a menu of nouns — Organization, DCIM, IPAM, Circuits, Virtualization, Wireless, and the rest. That menu is the whole model in one glance: NetBox thinks in places, devices, addresses and connections, and the next four chapters take them in the order the records depend on each other.

What an empty NetBox cannot do yet

Nothing is wrong, but notice what the empty install cannot express: you cannot add a device yet, because a device needs a type, a role and a site to belong to, and none exist. NetBox insists on the scaffolding first — chapter 5 and 6 build it — and that insistence is the difference between a database and a spreadsheet that this guide keeps coming back to.