{"id":8343,"library":"nautobot","title":"Nautobot Network Automation Platform","description":"Nautobot is an open source network source of truth and automation platform built on Django. It provides a highly extensible data model for network inventory, IP address management (IPAM), and device configuration, alongside a powerful framework for custom automation jobs and plugins. The current version is 3.1.0, with frequent patch releases across major versions (2.x, 3.x) and a new major version released approximately every 6-12 months.","status":"active","version":"3.1.0","language":"en","source_language":"en","source_url":"https://github.com/nautobot/nautobot","tags":["network automation","dcim","ipam","source of truth","django","network management","orchestration"],"install":[{"cmd":"pip install nautobot","lang":"bash","label":"Install core library"}],"dependencies":[{"reason":"Nautobot is a Django application and requires a PostgreSQL database. Version 14.0 or newer is required for Nautobot 3.1+.","package":"PostgreSQL","optional":false},{"reason":"Required for caching and task queuing.","package":"Redis","optional":false}],"imports":[{"note":"Base class for creating custom automation jobs.","symbol":"Job","correct":"from nautobot.extras.jobs import Job"},{"note":"Common model import for interacting with device data.","symbol":"Device","correct":"from nautobot.dcim.models import Device"},{"note":"Common model import for interacting with IP address data.","symbol":"IPAddress","correct":"from nautobot.ipam.models import IPAddress"},{"note":"Base class for defining Nautobot plugins.","symbol":"PluginConfig","correct":"from nautobot.extras.plugins import PluginConfig"}],"quickstart":{"code":"from nautobot.dcim.models import Device\nfrom nautobot.extras.jobs import Job\n\n# Example: A simple job to list devices\nclass MyFirstJob(Job):\n    name = \"My First Nautobot Job\"\n    description = \"A simple job to list devices and log their names.\"\n    task_queue = \"default\"\n\n    def run(self, data, commit):\n        self.log_info(message=\"Starting MyFirstJob...\")\n        devices = Device.objects.all()\n        self.log_info(f\"Found {devices.count()} devices in the database.\")\n        for device in devices:\n            self.log_info(f\"- Device: {device.name}, Status: {device.status}\")\n        self.log_success(\"Job completed successfully!\")\n        return \"Success\"\n\n# To make this job available in Nautobot:\n# 1. Save this code as 'my_job.py' (or similar) in a directory configured for Nautobot jobs.\n# 2. In the Nautobot UI, navigate to Jobs, find 'My First Nautobot Job', and click 'Run'.\n# This quickstart demonstrates how to define a Job that interacts with Nautobot models\n# and is executed by the Nautobot platform.","lang":"python","description":"This quickstart demonstrates defining a basic Nautobot Job, a common way to extend Nautobot's functionality using Python. The `Job` class provides methods for interacting with Nautobot models and logging. This code is designed to be saved within a Nautobot job directory and executed via the Nautobot UI or `nautobot-server runjob` command, making use of the library's internal context."},"warnings":[{"fix":"Upgrade your PostgreSQL database to version 14.0 or higher before upgrading to Nautobot 3.1.","message":"Nautobot 3.1 drops support for PostgreSQL versions 12.x and 13.x. A minimum of PostgreSQL 14.0 is now required.","severity":"breaking","affected_versions":"3.1.0+"},{"fix":"Review Django 5.2 release notes and test custom plugins thoroughly before upgrading. Update plugin code to adhere to Django 5.2 API changes.","message":"Nautobot 3.1 upgrades its core Django dependency to Django 5.2. This may introduce breaking changes for custom plugins or apps that rely on specific Django versions or deprecated features, particularly if they are not actively maintained.","severity":"breaking","affected_versions":"3.1.0+"},{"fix":"Regularly review Nautobot release notes for indirect dependency security updates. Manually run `pip install --upgrade <package_name>` for affected packages or reinstall your virtual environment.","message":"Security updates in patch releases often mention indirect dependencies (e.g., `pygments`, `pyasn1`, `pyjwt`) that do not automatically update with `pip install --upgrade nautobot`. You must manually update your Python environment's global or virtual environment dependencies.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the official Nautobot upgrade guides for detailed migration instructions for each major version. Plan for code review and testing of custom plugins and jobs.","message":"Significant API changes can occur between major Nautobot versions (e.g., from 2.x to 3.x), particularly affecting plugin and job development due to underlying Django and Django REST Framework upgrades. Existing custom code may require substantial refactoring.","severity":"gotcha","affected_versions":"Major version upgrades (e.g., 2.x -> 3.x)"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Create the PostgreSQL database and user, then update `nautobot_config.py` with the correct database connection details and run `./nautobot-server migrate`.","cause":"Nautobot requires a PostgreSQL database that has not been created or the connection details in `nautobot_config.py` are incorrect.","error":"django.db.utils.OperationalError: FATAL: database \"nautobot\" does not exist"},{"fix":"Upgrade your PostgreSQL server to version 14.0 or newer to meet Nautobot's requirements.","cause":"Attempting to run Nautobot 3.1 or later with an older, unsupported PostgreSQL version.","error":"Your installed PostgreSQL version (X.Y) is not supported by Nautobot 3.1. Minimum required is 14.0."},{"fix":"Ensure `nautobot` is installed (`pip install nautobot`) and run your Python script within the Nautobot context (e.g., as a custom job, plugin, or via `./nautobot-server shell`).","cause":"This error typically occurs when Python code attempting to import Nautobot models is run outside of a properly configured Nautobot/Django environment, or if `nautobot` is not installed.","error":"ModuleNotFoundError: No module named 'nautobot.dcim.models'"},{"fix":"For standalone scripts, it's recommended to interact via the `nautobot-server shell` or create a custom Nautobot Job or Plugin. If truly necessary for a standalone script, manually set `os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'nautobot.core.settings')` and call `django.setup()` before importing Django-dependent modules, though this approach is often fragile.","cause":"You are trying to use Django components (like models) without properly initializing Django's settings. This is common when running standalone scripts.","error":"django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings have not been configured."}]}