nautobot 1.6.28__py3-none-any.whl → 1.6.30__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of nautobot might be problematic. Click here for more details.

@@ -691,6 +691,24 @@ class CoreConfig(NautobotConfig):
691
691
 
692
692
  monkey_mix(TaggableManager, mixins.TaggableManagerMonkeyMixin)
693
693
 
694
+ # The code block below is to address an issue describe in https://www.cvedetails.com/cve/CVE-2024-42005/
695
+ # An issue was discovered in Django 5.0 before 5.0.8 and 4.2 before 4.2.15.
696
+ # QuerySet.values() and values_list() methods on models with a JSONField are subject to SQL injection
697
+ # in column aliases via a crafted JSON object key as a passed *arg.
698
+ # The fix in Django 4.2 https://github.com/django/django/commit/f4af67b9b41e0f4c117a8741da3abbd1c869ab28/
699
+ # is backported here to Nautobot v1.6.x running on Django 3.2.
700
+ from django.db.models.sql.query import Query
701
+
702
+ Query._set_values = Query.set_values
703
+
704
+ def set_values(self, fields):
705
+ if fields:
706
+ for field in fields:
707
+ self.check_alias(field)
708
+ self._set_values(fields)
709
+
710
+ Query.set_values = set_values
711
+
694
712
 
695
713
  class NautobotConstanceConfig(ConstanceConfig):
696
714
  """Override "Constance" app name to "Configuration"."""
@@ -4,7 +4,8 @@ from unittest.mock import patch
4
4
 
5
5
  from django.core.cache import cache
6
6
  from django.core.exceptions import ValidationError
7
- from django.test import override_settings
7
+ from django.db import models
8
+ from django.test import override_settings, skipUnlessDBFeature
8
9
 
9
10
  from nautobot.core.models import BaseModel
10
11
  from nautobot.utilities.testing import TestCase
@@ -15,6 +16,12 @@ class BaseModelTest(TestCase):
15
16
  def clean(self):
16
17
  raise ValidationError("validation error")
17
18
 
19
+ class JSONFieldModel(BaseModel):
20
+ data = models.JSONField(null=True)
21
+
22
+ class Meta:
23
+ required_db_features = {"supports_json_field"}
24
+
18
25
  def test_validated_save_calls_full_clean(self):
19
26
  with self.assertRaises(ValidationError):
20
27
  self.FakeBaseModel().validated_save()
@@ -61,3 +68,12 @@ class BaseModelTest(TestCase):
61
68
  self.FakeBaseModel._content_type_cached
62
69
  self.FakeBaseModel._content_type_cached
63
70
  self.assertEqual(mock__content_type.call_count, 2)
71
+
72
+ @skipUnlessDBFeature("supports_json_field")
73
+ def test_values_expression_alias_sql_injection_json_field(self):
74
+ crafted_alias = """injected_name" from "expressions_company"; --"""
75
+ msg = "Column aliases cannot contain whitespace characters, quotation marks, semicolons, or SQL comments."
76
+ with self.assertRaisesMessage(ValueError, msg):
77
+ self.JSONFieldModel.objects.values(f"data__{crafted_alias}")
78
+ with self.assertRaisesMessage(ValueError, msg):
79
+ self.JSONFieldModel.objects.values_list(f"data__{crafted_alias}")
nautobot/dcim/views.py CHANGED
@@ -2257,7 +2257,7 @@ class DeviceBayPopulateView(generic.ObjectEditView):
2257
2257
  f"Added {device_bay.installed_device} to {device_bay}.",
2258
2258
  )
2259
2259
 
2260
- return redirect("dcim:device", pk=device_bay.device.pk)
2260
+ return redirect("dcim:device_devicebays", pk=device_bay.device.pk)
2261
2261
 
2262
2262
  return render(
2263
2263
  request,
@@ -2300,7 +2300,7 @@ class DeviceBayDepopulateView(generic.ObjectEditView):
2300
2300
  f"Removed {removed_device} from {device_bay}.",
2301
2301
  )
2302
2302
 
2303
- return redirect("dcim:device", pk=device_bay.device.pk)
2303
+ return redirect("dcim:device_devicebays", pk=device_bay.device.pk)
2304
2304
 
2305
2305
  return render(
2306
2306
  request,
@@ -3464,26 +3464,6 @@
3464
3464
  Setting up your Remotes
3465
3465
  </a>
3466
3466
 
3467
- </li>
3468
-
3469
- <li class="md-nav__item">
3470
- <a href="#creating-a-branch" class="md-nav__link">
3471
- Creating a Branch
3472
- </a>
3473
-
3474
- <nav class="md-nav" aria-label="Creating a Branch">
3475
- <ul class="md-nav__list">
3476
-
3477
- <li class="md-nav__item">
3478
- <a href="#prototypes" class="md-nav__link">
3479
- Prototypes
3480
- </a>
3481
-
3482
- </li>
3483
-
3484
- </ul>
3485
- </nav>
3486
-
3487
3467
  </li>
3488
3468
 
3489
3469
  </ul>
@@ -3642,6 +3622,26 @@
3642
3622
  <nav class="md-nav" aria-label="Working in your Development Environment">
3643
3623
  <ul class="md-nav__list">
3644
3624
 
3625
+ <li class="md-nav__item">
3626
+ <a href="#creating-a-branch" class="md-nav__link">
3627
+ Creating a Branch
3628
+ </a>
3629
+
3630
+ <nav class="md-nav" aria-label="Creating a Branch">
3631
+ <ul class="md-nav__list">
3632
+
3633
+ <li class="md-nav__item">
3634
+ <a href="#prototypes" class="md-nav__link">
3635
+ Prototypes
3636
+ </a>
3637
+
3638
+ </li>
3639
+
3640
+ </ul>
3641
+ </nav>
3642
+
3643
+ </li>
3644
+
3645
3645
  <li class="md-nav__item">
3646
3646
  <a href="#creating-a-superuser" class="md-nav__link">
3647
3647
  Creating a Superuser
@@ -4411,26 +4411,6 @@
4411
4411
  Setting up your Remotes
4412
4412
  </a>
4413
4413
 
4414
- </li>
4415
-
4416
- <li class="md-nav__item">
4417
- <a href="#creating-a-branch" class="md-nav__link">
4418
- Creating a Branch
4419
- </a>
4420
-
4421
- <nav class="md-nav" aria-label="Creating a Branch">
4422
- <ul class="md-nav__list">
4423
-
4424
- <li class="md-nav__item">
4425
- <a href="#prototypes" class="md-nav__link">
4426
- Prototypes
4427
- </a>
4428
-
4429
- </li>
4430
-
4431
- </ul>
4432
- </nav>
4433
-
4434
4414
  </li>
4435
4415
 
4436
4416
  </ul>
@@ -4589,6 +4569,26 @@
4589
4569
  <nav class="md-nav" aria-label="Working in your Development Environment">
4590
4570
  <ul class="md-nav__list">
4591
4571
 
4572
+ <li class="md-nav__item">
4573
+ <a href="#creating-a-branch" class="md-nav__link">
4574
+ Creating a Branch
4575
+ </a>
4576
+
4577
+ <nav class="md-nav" aria-label="Creating a Branch">
4578
+ <ul class="md-nav__list">
4579
+
4580
+ <li class="md-nav__item">
4581
+ <a href="#prototypes" class="md-nav__link">
4582
+ Prototypes
4583
+ </a>
4584
+
4585
+ </li>
4586
+
4587
+ </ul>
4588
+ </nav>
4589
+
4590
+ </li>
4591
+
4592
4592
  <li class="md-nav__item">
4593
4593
  <a href="#creating-a-superuser" class="md-nav__link">
4594
4594
  Creating a Superuser
@@ -4844,24 +4844,6 @@
4844
4844
  <p class="admonition-title">Hint</p>
4845
4845
  <p>You will always <strong>push</strong> changes to <code>origin</code> (your fork) and <strong>pull</strong> changes from <code>upstream</code> (official repo).</p>
4846
4846
  </div>
4847
- <h3 id="creating-a-branch">Creating a Branch<a class="headerlink" href="#creating-a-branch" title="Permanent link">&para;</a></h3>
4848
- <p>Before you make any changes, always create a new branch. Again, for bug fixes and minor features, you'll want to create your branches from the <code>develop</code> branch, while for major new features, you'll branch from <code>next</code> instead.</p>
4849
- <p>Before you ever create a new branch, always checkout the appropriate branch and make sure you you've got the latest changes from <code>upstream</code>:</p>
4850
- <div class="highlight"><pre><span></span><code><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a>git checkout develop
4851
- <a id="__codelineno-9-2" name="__codelineno-9-2" href="#__codelineno-9-2"></a>git pull upstream develop
4852
- </code></pre></div>
4853
- <div class="admonition warning">
4854
- <p class="admonition-title">Warning</p>
4855
- <p>If you do not do this, you run the risk of having merge conflicts in your branch, and that's never fun to deal with. Trust us on this one.</p>
4856
- </div>
4857
- <p>Now that you've got the latest upstream changes, create your branch. Whether you're creating a branch off a fork or working against the Nautobot origin repo, you should follow this convention for naming your branch: <code>u/yourusername-0000-branch-summary</code>, where <code>0000</code> is the related GitHub issue number and <code>yourusername</code> is your GitHub username. For example:</p>
4858
- <div class="highlight"><pre><span></span><code><a id="__codelineno-10-1" name="__codelineno-10-1" href="#__codelineno-10-1"></a>git checkout -b u/yourusername-1234-next-amazing-feature
4859
- </code></pre></div>
4860
- <p>If you do not have a relevant GitHub issue, please consider opening one to document the context behind your changes.</p>
4861
- <h4 id="prototypes">Prototypes<a class="headerlink" href="#prototypes" title="Permanent link">&para;</a></h4>
4862
- <p>Sometimes code is written as a proof of concept or early implementation candidate but is not quite ready to be merged, or may be picked up by another author sometime in the future. In that case, the convention is to use the <code>prototype/</code> prefix to the branch name and not requiring the original authors username. In that scenario, using the example above, you would instead:</p>
4863
- <div class="highlight"><pre><span></span><code><a id="__codelineno-11-1" name="__codelineno-11-1" href="#__codelineno-11-1"></a>git checkout -b prototype/1234-next-amazing-feature
4864
- </code></pre></div>
4865
4847
  <h2 id="enabling-pre-commit-hooks">Enabling Pre-Commit Hooks<a class="headerlink" href="#enabling-pre-commit-hooks" title="Permanent link">&para;</a></h2>
4866
4848
  <p>Nautobot ships with a <a href="https://githooks.com/">Git pre-commit hook</a> script that automatically checks for style compliance and missing database migrations prior to committing changes. This helps avoid erroneous commits that result in CI test failures.</p>
4867
4849
  <div class="admonition note">
@@ -4869,15 +4851,15 @@
4869
4851
  <p>This pre-commit hook currently only supports the Python Virtual Environment Workflow.</p>
4870
4852
  </div>
4871
4853
  <p>You are encouraged to enable it by creating a link to <code>scripts/git-hooks/pre-commit</code>:</p>
4872
- <div class="highlight"><pre><span></span><code><a id="__codelineno-12-1" name="__codelineno-12-1" href="#__codelineno-12-1"></a>cd .git/hooks/
4873
- <a id="__codelineno-12-2" name="__codelineno-12-2" href="#__codelineno-12-2"></a>ln -s ../../scripts/git-hooks/pre-commit
4854
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a>cd .git/hooks/
4855
+ <a id="__codelineno-9-2" name="__codelineno-9-2" href="#__codelineno-9-2"></a>ln -s ../../scripts/git-hooks/pre-commit
4874
4856
  </code></pre></div>
4875
4857
  <h2 id="setting-up-your-development-environment">Setting up your Development Environment<a class="headerlink" href="#setting-up-your-development-environment" title="Permanent link">&para;</a></h2>
4876
4858
  <p>Getting started with Nautobot development is pretty straightforward, and should feel very familiar to anyone with Django development experience. We can recommend either a <a href="#docker-compose-workflow">Docker Compose workflow</a> (if you don't want to install dependencies such as PostgreSQL and Redis directly onto your system) or a <a href="#python-virtual-environment-workflow">Python virtual environment workflow</a>.</p>
4877
4859
  <h3 id="windows-development">Windows Development<a class="headerlink" href="#windows-development" title="Permanent link">&para;</a></h3>
4878
4860
  <p>The Docker Compose development workflow on Windows Subsystem for Linux (WSL) has been tested successfully with <a href="https://docs.docker.com/desktop/windows/wsl/">Docker Desktop using the WSL2 backend</a> and the Ubuntu 20.04 WSL2 distribution. The Poetry workflow has also been tested successfully on the Ubuntu 20.04 WSL2 distribution.</p>
4879
4861
  <p>To install WSL2 and Ubuntu follow the instructions from the <a href="https://learn.microsoft.com/en-us/windows/wsl/install">WSL installation guide</a> or if running Windows 10 version 2004 and higher you can open an administrator Powershell terminal and enter the following command:</p>
4880
- <div class="highlight"><pre><span></span><code><a id="__codelineno-13-1" name="__codelineno-13-1" href="#__codelineno-13-1"></a><span class="n">wsl</span> <span class="p">-</span><span class="n">-install</span>
4862
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-10-1" name="__codelineno-10-1" href="#__codelineno-10-1"></a><span class="n">wsl</span> <span class="p">-</span><span class="n">-install</span>
4881
4863
  </code></pre></div>
4882
4864
  <p>This will install the WSL2 Ubuntu distribution. Reboot if prompted. After the image installs successfully you may install Docker Desktop with the WSL2 backend.</p>
4883
4865
  <h3 id="docker-compose-workflow">Docker Compose Workflow<a class="headerlink" href="#docker-compose-workflow" title="Permanent link">&para;</a></h3>
@@ -4889,63 +4871,66 @@
4889
4871
  </div>
4890
4872
  <h4 id="install-invoke">Install Invoke<a class="headerlink" href="#install-invoke" title="Permanent link">&para;</a></h4>
4891
4873
  <p>Because it is used to execute all common Docker workflow tasks, Invoke must be installed for your user environment. On most systems, if you're installing without root/superuser permissions, the default will install into your local user environment.</p>
4892
- <div class="highlight"><pre><span></span><code><a id="__codelineno-14-1" name="__codelineno-14-1" href="#__codelineno-14-1"></a>pip3 install invoke
4874
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-11-1" name="__codelineno-11-1" href="#__codelineno-11-1"></a>pip3 install invoke
4893
4875
  </code></pre></div>
4894
4876
  <p>If you run into issues, you may also deliberately tell <code>pip3</code> to install into your user environment by adding the <code>--user</code> flag:</p>
4895
- <div class="highlight"><pre><span></span><code><a id="__codelineno-15-1" name="__codelineno-15-1" href="#__codelineno-15-1"></a>pip3 install --user invoke
4877
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-12-1" name="__codelineno-12-1" href="#__codelineno-12-1"></a>pip3 install --user invoke
4896
4878
  </code></pre></div>
4897
4879
  <p>Please see the <a href="https://pip.pypa.io/en/stable/user_guide/#user-installs">official documentation on Pip user installs</a> for more information.</p>
4898
4880
  <h4 id="list-invoke-tasks">List Invoke Tasks<a class="headerlink" href="#list-invoke-tasks" title="Permanent link">&para;</a></h4>
4899
4881
  <p>Now that you have an <code>invoke</code> command, list the tasks defined in <code>tasks.py</code>:</p>
4900
- <div class="highlight"><pre><span></span><code><a id="__codelineno-16-1" name="__codelineno-16-1" href="#__codelineno-16-1"></a>invoke --list
4882
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-13-1" name="__codelineno-13-1" href="#__codelineno-13-1"></a>invoke --list
4901
4883
  </code></pre></div>
4902
4884
  <p>Example output:</p>
4903
- <div class="highlight"><pre><span></span><code><a id="__codelineno-17-1" name="__codelineno-17-1" href="#__codelineno-17-1"></a>Available tasks:
4904
- <a id="__codelineno-17-2" name="__codelineno-17-2" href="#__codelineno-17-2"></a>
4905
- <a id="__codelineno-17-3" name="__codelineno-17-3" href="#__codelineno-17-3"></a> black Check Python code style with Black.
4906
- <a id="__codelineno-17-4" name="__codelineno-17-4" href="#__codelineno-17-4"></a> build Build Nautobot docker image.
4907
- <a id="__codelineno-17-5" name="__codelineno-17-5" href="#__codelineno-17-5"></a> build-and-check-docs Build docs for use within Nautobot.
4908
- <a id="__codelineno-17-6" name="__codelineno-17-6" href="#__codelineno-17-6"></a> buildx Build Nautobot docker image using the experimental buildx docker functionality (multi-arch
4909
- <a id="__codelineno-17-7" name="__codelineno-17-7" href="#__codelineno-17-7"></a> capablility).
4910
- <a id="__codelineno-17-8" name="__codelineno-17-8" href="#__codelineno-17-8"></a> check-migrations Check for missing migrations.
4911
- <a id="__codelineno-17-9" name="__codelineno-17-9" href="#__codelineno-17-9"></a> check-schema Render the REST API schema and check for problems.
4912
- <a id="__codelineno-17-10" name="__codelineno-17-10" href="#__codelineno-17-10"></a> cli Launch a bash shell inside the running Nautobot (or other) Docker container.
4913
- <a id="__codelineno-17-11" name="__codelineno-17-11" href="#__codelineno-17-11"></a> createsuperuser Create a new Nautobot superuser account (default: &quot;admin&quot;), will prompt for password.
4914
- <a id="__codelineno-17-12" name="__codelineno-17-12" href="#__codelineno-17-12"></a> debug Start Nautobot and its dependencies in debug mode.
4915
- <a id="__codelineno-17-13" name="__codelineno-17-13" href="#__codelineno-17-13"></a> destroy Destroy all containers and volumes.
4916
- <a id="__codelineno-17-14" name="__codelineno-17-14" href="#__codelineno-17-14"></a> docker-push Tags and pushes docker images to the appropriate repos, intended for release use only.
4917
- <a id="__codelineno-17-15" name="__codelineno-17-15" href="#__codelineno-17-15"></a> dumpdata Dump data from database to db_output file.
4918
- <a id="__codelineno-17-16" name="__codelineno-17-16" href="#__codelineno-17-16"></a> flake8 Check for PEP8 compliance and other style issues.
4919
- <a id="__codelineno-17-17" name="__codelineno-17-17" href="#__codelineno-17-17"></a> hadolint Check Dockerfile for hadolint compliance and other style issues.
4920
- <a id="__codelineno-17-18" name="__codelineno-17-18" href="#__codelineno-17-18"></a> integration-test Run Nautobot integration tests.
4921
- <a id="__codelineno-17-19" name="__codelineno-17-19" href="#__codelineno-17-19"></a> loaddata Load data from file.
4922
- <a id="__codelineno-17-20" name="__codelineno-17-20" href="#__codelineno-17-20"></a> makemigrations Perform makemigrations operation in Django.
4923
- <a id="__codelineno-17-21" name="__codelineno-17-21" href="#__codelineno-17-21"></a> markdownlint Lint Markdown files.
4924
- <a id="__codelineno-17-22" name="__codelineno-17-22" href="#__codelineno-17-22"></a> migrate Perform migrate operation in Django.
4925
- <a id="__codelineno-17-23" name="__codelineno-17-23" href="#__codelineno-17-23"></a> nbshell Launch an interactive nbshell session.
4926
- <a id="__codelineno-17-24" name="__codelineno-17-24" href="#__codelineno-17-24"></a> performance-test Run Nautobot performance specific unit tests.
4927
- <a id="__codelineno-17-25" name="__codelineno-17-25" href="#__codelineno-17-25"></a> post-upgrade Performs Nautobot common post-upgrade operations using a single entrypoint.
4928
- <a id="__codelineno-17-26" name="__codelineno-17-26" href="#__codelineno-17-26"></a> pylint Perform static analysis of Nautobot code.
4929
- <a id="__codelineno-17-27" name="__codelineno-17-27" href="#__codelineno-17-27"></a> restart Gracefully restart containers.
4930
- <a id="__codelineno-17-28" name="__codelineno-17-28" href="#__codelineno-17-28"></a> start Start Nautobot and its dependencies in detached mode.
4931
- <a id="__codelineno-17-29" name="__codelineno-17-29" href="#__codelineno-17-29"></a> stop Stop Nautobot and its dependencies.
4932
- <a id="__codelineno-17-30" name="__codelineno-17-30" href="#__codelineno-17-30"></a> tests Run all linters and unit tests.
4933
- <a id="__codelineno-17-31" name="__codelineno-17-31" href="#__codelineno-17-31"></a> unittest Run Nautobot unit tests.
4934
- <a id="__codelineno-17-32" name="__codelineno-17-32" href="#__codelineno-17-32"></a> unittest-coverage Report on code test coverage as measured by &#39;invoke unittest&#39;.
4935
- <a id="__codelineno-17-33" name="__codelineno-17-33" href="#__codelineno-17-33"></a> vscode Launch Visual Studio Code with the appropriate Environment variables to run in a container.
4885
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-14-1" name="__codelineno-14-1" href="#__codelineno-14-1"></a>Available tasks:
4886
+ <a id="__codelineno-14-2" name="__codelineno-14-2" href="#__codelineno-14-2"></a>
4887
+ <a id="__codelineno-14-3" name="__codelineno-14-3" href="#__codelineno-14-3"></a> black Check Python code style with Black.
4888
+ <a id="__codelineno-14-4" name="__codelineno-14-4" href="#__codelineno-14-4"></a> branch Switch to a different Git branch, creating it if requested.
4889
+ <a id="__codelineno-14-5" name="__codelineno-14-5" href="#__codelineno-14-5"></a> build Build Nautobot docker image.
4890
+ <a id="__codelineno-14-6" name="__codelineno-14-6" href="#__codelineno-14-6"></a> build-and-check-docs Build docs for use within Nautobot.
4891
+ <a id="__codelineno-14-7" name="__codelineno-14-7" href="#__codelineno-14-7"></a> buildx Build Nautobot docker image using the experimental buildx docker functionality (multi-arch
4892
+ <a id="__codelineno-14-8" name="__codelineno-14-8" href="#__codelineno-14-8"></a> capablility).
4893
+ <a id="__codelineno-14-9" name="__codelineno-14-9" href="#__codelineno-14-9"></a> check-migrations Check for missing migrations.
4894
+ <a id="__codelineno-14-10" name="__codelineno-14-10" href="#__codelineno-14-10"></a> check-schema Render the REST API schema and check for problems.
4895
+ <a id="__codelineno-14-11" name="__codelineno-14-11" href="#__codelineno-14-11"></a> cli Launch a bash shell inside the running Nautobot (or other) Docker container.
4896
+ <a id="__codelineno-14-12" name="__codelineno-14-12" href="#__codelineno-14-12"></a> createsuperuser Create a new Nautobot superuser account (default: &quot;admin&quot;), will prompt for password.
4897
+ <a id="__codelineno-14-13" name="__codelineno-14-13" href="#__codelineno-14-13"></a> debug Start Nautobot and its dependencies in debug mode.
4898
+ <a id="__codelineno-14-14" name="__codelineno-14-14" href="#__codelineno-14-14"></a> destroy Destroy all containers and volumes.
4899
+ <a id="__codelineno-14-15" name="__codelineno-14-15" href="#__codelineno-14-15"></a> docker-push Tags and pushes docker images to the appropriate repos, intended for release use only.
4900
+ <a id="__codelineno-14-16" name="__codelineno-14-16" href="#__codelineno-14-16"></a> dumpdata Dump data from database to db_output file.
4901
+ <a id="__codelineno-14-17" name="__codelineno-14-17" href="#__codelineno-14-17"></a> flake8 Check for PEP8 compliance and other style issues.
4902
+ <a id="__codelineno-14-18" name="__codelineno-14-18" href="#__codelineno-14-18"></a> hadolint Check Dockerfile for hadolint compliance and other style issues.
4903
+ <a id="__codelineno-14-19" name="__codelineno-14-19" href="#__codelineno-14-19"></a> integration-test Run Nautobot integration tests.
4904
+ <a id="__codelineno-14-20" name="__codelineno-14-20" href="#__codelineno-14-20"></a> loaddata Load data from file.
4905
+ <a id="__codelineno-14-21" name="__codelineno-14-21" href="#__codelineno-14-21"></a> makemigrations Perform makemigrations operation in Django.
4906
+ <a id="__codelineno-14-22" name="__codelineno-14-22" href="#__codelineno-14-22"></a> markdownlint Lint Markdown files.
4907
+ <a id="__codelineno-14-23" name="__codelineno-14-23" href="#__codelineno-14-23"></a> migrate Perform migrate operation in Django.
4908
+ <a id="__codelineno-14-24" name="__codelineno-14-24" href="#__codelineno-14-24"></a> nbshell Launch an interactive nbshell session.
4909
+ <a id="__codelineno-14-25" name="__codelineno-14-25" href="#__codelineno-14-25"></a> performance-test Run Nautobot performance specific unit tests.
4910
+ <a id="__codelineno-14-26" name="__codelineno-14-26" href="#__codelineno-14-26"></a> post-upgrade Performs Nautobot common post-upgrade operations using a single entrypoint.
4911
+ <a id="__codelineno-14-27" name="__codelineno-14-27" href="#__codelineno-14-27"></a> pylint Perform static analysis of Nautobot code.
4912
+ <a id="__codelineno-14-28" name="__codelineno-14-28" href="#__codelineno-14-28"></a> restart Gracefully restart containers.
4913
+ <a id="__codelineno-14-29" name="__codelineno-14-29" href="#__codelineno-14-29"></a> start Start Nautobot and its dependencies in detached mode.
4914
+ <a id="__codelineno-14-30" name="__codelineno-14-30" href="#__codelineno-14-30"></a> stop Stop Nautobot and its dependencies.
4915
+ <a id="__codelineno-14-31" name="__codelineno-14-31" href="#__codelineno-14-31"></a> tests Run all linters and unit tests.
4916
+ <a id="__codelineno-14-32" name="__codelineno-14-32" href="#__codelineno-14-32"></a> unittest Run Nautobot unit tests.
4917
+ <a id="__codelineno-14-33" name="__codelineno-14-33" href="#__codelineno-14-33"></a> unittest-coverage Report on code test coverage as measured by &#39;invoke unittest&#39;.
4918
+ <a id="__codelineno-14-34" name="__codelineno-14-34" href="#__codelineno-14-34"></a> vscode Launch Visual Studio Code with the appropriate Environment variables to run in a container.
4936
4919
  </code></pre></div>
4937
4920
  <h4 id="using-docker-with-invoke">Using Docker with Invoke<a class="headerlink" href="#using-docker-with-invoke" title="Permanent link">&para;</a></h4>
4938
4921
  <p>A development environment can be easily started up from the root of the project using the following commands:</p>
4939
4922
  <ul>
4940
- <li><code>invoke build</code> - Builds Nautobot docker images</li>
4923
+ <li><code>invoke branch</code> - Creates or switches to the appropriate Git branch</li>
4924
+ <li><code>invoke build</code> - Builds Nautobot docker images appropriate to the current Git branch</li>
4941
4925
  <li><code>invoke migrate</code> - Performs database migration operation in Django</li>
4942
4926
  <li><code>invoke createsuperuser</code> - Creates a superuser account for the Nautobot application</li>
4943
4927
  <li><code>invoke debug</code> - Starts Docker containers for Nautobot, PostgreSQL, Redis, Celery, and the RQ worker in debug mode and attaches their output to the terminal in the foreground. You may enter Control-C to stop the containers</li>
4944
4928
  </ul>
4945
4929
  <p>Additional useful commands for the development environment:</p>
4946
4930
  <ul>
4947
- <li><code>invoke start [-s servicename]</code> - Starts Docker containers for Nautobot, PostgreSQL, Redis, Celery, and the RQ worker (or a specific container/service, such as <code>invoke start -s redis</code>) to run in the background with debug disabled</li>
4948
- <li><code>invoke cli [-s servicename]</code> - Launch a <code>bash</code> shell inside the specified service container (if none is specified, defaults to the Nautobot container)</li>
4931
+ <li><code>invoke start [-s servicename]</code> - Starts Docker containers for Nautobot, PostgreSQL, Redis, Celery, and the RQ worker (or a specific container/service, such as <code>invoke start -s redis</code>) to run in the background</li>
4932
+ <li><code>invoke nbshell</code> - Launches a Nautobot Python shell inside the Nautobot container</li>
4933
+ <li><code>invoke cli [-s servicename]</code> - Launches a <code>bash</code> shell inside the specified service container (if none is specified, defaults to the Nautobot container)</li>
4949
4934
  <li><code>invoke stop [-s servicename]</code> - Stops all containers (or a specific container/service) created by <code>invoke start</code></li>
4950
4935
  </ul>
4951
4936
  <div class="admonition note">
@@ -4974,7 +4959,7 @@
4974
4959
  <h4 id="install-poetry">Install Poetry<a class="headerlink" href="#install-poetry" title="Permanent link">&para;</a></h4>
4975
4960
  <p><a href="https://python-poetry.org/docs/">Poetry</a> is a tool for dependency management and packaging in Python. It allows you to declare the libraries your project depends on and it will manage (install/update/remove) them for you. It will also manage virtual environments automatically, and allow for publishing packages to the <a href="https://pypi.org">Python Package Index</a>.</p>
4976
4961
  <p>You may install Poetry in your user environment by running:</p>
4977
- <div class="highlight"><pre><span></span><code><a id="__codelineno-18-1" name="__codelineno-18-1" href="#__codelineno-18-1"></a>curl -sSL https://install.python-poetry.org | python3 -
4962
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-15-1" name="__codelineno-15-1" href="#__codelineno-15-1"></a>curl -sSL https://install.python-poetry.org | python3 -
4978
4963
  </code></pre></div>
4979
4964
  <div class="admonition version-changed">
4980
4965
  <p class="admonition-title">Changed in version 1.5.6</p>
@@ -4989,17 +4974,17 @@
4989
4974
  <p>For detailed installation instructions, please see the <a href="https://python-poetry.org/docs/#installation">official Poetry installation guide</a>.</p>
4990
4975
  <h4 id="install-hadolint">Install Hadolint<a class="headerlink" href="#install-hadolint" title="Permanent link">&para;</a></h4>
4991
4976
  <p><a href="https://github.com/hadolint/hadolint">Hadolint</a> is a tool used to validate and lint Dockerfiles to ensure we are following best practices. On macOS with <a href="https://brew.sh/">Homebrew</a> you can install Hadolint by running:</p>
4992
- <div class="highlight"><pre><span></span><code><a id="__codelineno-19-1" name="__codelineno-19-1" href="#__codelineno-19-1"></a>brew install hadolint
4977
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-16-1" name="__codelineno-16-1" href="#__codelineno-16-1"></a>brew install hadolint
4993
4978
  </code></pre></div>
4994
4979
  <h4 id="install-markdownlint-cli">Install markdownlint-cli<a class="headerlink" href="#install-markdownlint-cli" title="Permanent link">&para;</a></h4>
4995
4980
  <p><a href="https://github.com/igorshubovych/markdownlint-cli">markdownlint-cli</a> is a tool used to validate and lint Markdown files, such as Nautobot's documentation, to ensure that they are correctly constructed. On macOS with <a href="https://brew.sh/">Homebrew</a> you can install markdownlint-cli by running:</p>
4996
- <div class="highlight"><pre><span></span><code><a id="__codelineno-20-1" name="__codelineno-20-1" href="#__codelineno-20-1"></a>brew install markdownlint-cli
4981
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-17-1" name="__codelineno-17-1" href="#__codelineno-17-1"></a>brew install markdownlint-cli
4997
4982
  </code></pre></div>
4998
4983
  <h4 id="creating-a-python-virtual-environment">Creating a Python Virtual Environment<a class="headerlink" href="#creating-a-python-virtual-environment" title="Permanent link">&para;</a></h4>
4999
4984
  <p>A Python <a href="https://docs.python.org/3/tutorial/venv.html">virtual environment</a> (or <em>virtualenv</em>) is like a container for a set of Python packages. A virtualenv allow you to build environments suited to specific projects without interfering with system packages or other projects. When installed per the documentation, Nautobot uses a virtual environment in production.</p>
5000
4985
  <p>For Nautobot development, we have selected Poetry, which will transparently create a virtualenv for you, automatically install all dependencies required for Nautobot to operate, and will also install the <code>nautobot-server</code> CLI command that you will utilize to interact with Nautobot from here on out.</p>
5001
4986
  <p>Bootstrap your virtual environment using <code>poetry install</code>:</p>
5002
- <div class="highlight"><pre><span></span><code><a id="__codelineno-21-1" name="__codelineno-21-1" href="#__codelineno-21-1"></a>poetry install
4987
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-18-1" name="__codelineno-18-1" href="#__codelineno-18-1"></a>poetry install
5003
4988
  </code></pre></div>
5004
4989
  <div class="admonition hint">
5005
4990
  <p class="admonition-title">Hint</p>
@@ -5007,44 +4992,44 @@
5007
4992
  </div>
5008
4993
  <p>This will create automatically create a virtualenv in your home directory, which houses a virtual copy of the Python executable and its related libraries and tooling. When running Nautobot for development, it will be run using the Python binary at found within the virtualenv.</p>
5009
4994
  <p>Once created, you may activate the virtual environment using <code>poetry shell</code>:</p>
5010
- <div class="highlight"><pre><span></span><code><a id="__codelineno-22-1" name="__codelineno-22-1" href="#__codelineno-22-1"></a>poetry shell
4995
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-19-1" name="__codelineno-19-1" href="#__codelineno-19-1"></a>poetry shell
5011
4996
  </code></pre></div>
5012
4997
  <p>Example output:</p>
5013
- <div class="highlight"><pre><span></span><code><a id="__codelineno-23-1" name="__codelineno-23-1" href="#__codelineno-23-1"></a>Spawning shell within /home/example/.cache/pypoetry/virtualenvs/nautobot-Ams_xyDt-py3.8
5014
- <a id="__codelineno-23-2" name="__codelineno-23-2" href="#__codelineno-23-2"></a>
5015
- <a id="__codelineno-23-3" name="__codelineno-23-3" href="#__codelineno-23-3"></a>. /home/example/.cache/pypoetry/virtualenvs/nautobot-Ams_xyDt-py3.8/bin/activate
5016
- <a id="__codelineno-23-4" name="__codelineno-23-4" href="#__codelineno-23-4"></a>(nautobot-Ams_xyDt-py3.8) $
4998
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-20-1" name="__codelineno-20-1" href="#__codelineno-20-1"></a>Spawning shell within /home/example/.cache/pypoetry/virtualenvs/nautobot-Ams_xyDt-py3.8
4999
+ <a id="__codelineno-20-2" name="__codelineno-20-2" href="#__codelineno-20-2"></a>
5000
+ <a id="__codelineno-20-3" name="__codelineno-20-3" href="#__codelineno-20-3"></a>. /home/example/.cache/pypoetry/virtualenvs/nautobot-Ams_xyDt-py3.8/bin/activate
5001
+ <a id="__codelineno-20-4" name="__codelineno-20-4" href="#__codelineno-20-4"></a>(nautobot-Ams_xyDt-py3.8) $
5017
5002
  </code></pre></div>
5018
5003
  <p>Notice that the console prompt changes to indicate the active environment. This updates the necessary system environment variables to ensure that any Python scripts are run within the virtual environment.</p>
5019
5004
  <p>Observe also that the <code>python</code> interpreter is bound within the virtualenv:</p>
5020
- <div class="highlight"><pre><span></span><code><a id="__codelineno-24-1" name="__codelineno-24-1" href="#__codelineno-24-1"></a>which python
5005
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-21-1" name="__codelineno-21-1" href="#__codelineno-21-1"></a>which python
5021
5006
  </code></pre></div>
5022
5007
  <p>Example output:</p>
5023
- <div class="highlight"><pre><span></span><code><a id="__codelineno-25-1" name="__codelineno-25-1" href="#__codelineno-25-1"></a>(nautobot-Ams_xyDt-py3.8) $ /home/example/.cache/pypoetry/virtualenvs/nautobot-Ams_xyDt-py3.8/bin/python
5008
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-22-1" name="__codelineno-22-1" href="#__codelineno-22-1"></a>(nautobot-Ams_xyDt-py3.8) $ /home/example/.cache/pypoetry/virtualenvs/nautobot-Ams_xyDt-py3.8/bin/python
5024
5009
  </code></pre></div>
5025
5010
  <p>To exit the virtual shell, use <code>exit</code>:</p>
5026
- <div class="highlight"><pre><span></span><code><a id="__codelineno-26-1" name="__codelineno-26-1" href="#__codelineno-26-1"></a>exit
5011
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-23-1" name="__codelineno-23-1" href="#__codelineno-23-1"></a>exit
5027
5012
  </code></pre></div>
5028
5013
  <p>Example output:</p>
5029
- <div class="highlight"><pre><span></span><code><a id="__codelineno-27-1" name="__codelineno-27-1" href="#__codelineno-27-1"></a>$
5014
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-24-1" name="__codelineno-24-1" href="#__codelineno-24-1"></a>$
5030
5015
  </code></pre></div>
5031
5016
  <h4 id="working-with-poetry">Working with Poetry<a class="headerlink" href="#working-with-poetry" title="Permanent link">&para;</a></h4>
5032
5017
  <p>Poetry automatically installs your dependencies. However, if you need to install any additional dependencies this can be done with <code>pip</code>. For example, if you really like using <code>ipython</code> for development:</p>
5033
- <div class="highlight"><pre><span></span><code><a id="__codelineno-28-1" name="__codelineno-28-1" href="#__codelineno-28-1"></a>pip3 install ipython
5018
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-25-1" name="__codelineno-25-1" href="#__codelineno-25-1"></a>pip3 install ipython
5034
5019
  </code></pre></div>
5035
5020
  <p>Example output:</p>
5036
- <div class="highlight"><pre><span></span><code><a id="__codelineno-29-1" name="__codelineno-29-1" href="#__codelineno-29-1"></a>Collecting ipython
5037
- <a id="__codelineno-29-2" name="__codelineno-29-2" href="#__codelineno-29-2"></a> Using cached ipython-7.20.0-py3-none-any.whl (784 kB)
5038
- <a id="__codelineno-29-3" name="__codelineno-29-3" href="#__codelineno-29-3"></a> ...
5021
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-26-1" name="__codelineno-26-1" href="#__codelineno-26-1"></a>Collecting ipython
5022
+ <a id="__codelineno-26-2" name="__codelineno-26-2" href="#__codelineno-26-2"></a> Using cached ipython-7.20.0-py3-none-any.whl (784 kB)
5023
+ <a id="__codelineno-26-3" name="__codelineno-26-3" href="#__codelineno-26-3"></a> ...
5039
5024
  </code></pre></div>
5040
5025
  <ul>
5041
5026
  <li>Install verify that you have the proper dependencies installed and are in the virtual environment via Poetry. This also ensures that you have the proper mkdocs themes installed.</li>
5042
5027
  </ul>
5043
- <div class="highlight"><pre><span></span><code><a id="__codelineno-30-1" name="__codelineno-30-1" href="#__codelineno-30-1"></a>poetry<span class="w"> </span>shell
5044
- <a id="__codelineno-30-2" name="__codelineno-30-2" href="#__codelineno-30-2"></a>poetry<span class="w"> </span>install
5028
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-27-1" name="__codelineno-27-1" href="#__codelineno-27-1"></a>poetry<span class="w"> </span>shell
5029
+ <a id="__codelineno-27-2" name="__codelineno-27-2" href="#__codelineno-27-2"></a>poetry<span class="w"> </span>install
5045
5030
  </code></pre></div>
5046
5031
  <p>It may not always be convenient to enter into the virtual shell just to run programs. You may also execute a given command ad hoc within the project's virtual shell by using <code>poetry run</code>:</p>
5047
- <div class="highlight"><pre><span></span><code><a id="__codelineno-31-1" name="__codelineno-31-1" href="#__codelineno-31-1"></a>poetry run mkdocs serve
5032
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-28-1" name="__codelineno-28-1" href="#__codelineno-28-1"></a>poetry run mkdocs serve
5048
5033
  </code></pre></div>
5049
5034
  <p>Check out the <a href="https://python-poetry.org/docs/basic-usage/">Poetry usage guide</a> for more tips.</p>
5050
5035
  <h4 id="configuring-nautobot">Configuring Nautobot<a class="headerlink" href="#configuring-nautobot" title="Permanent link">&para;</a></h4>
@@ -5059,20 +5044,20 @@
5059
5044
  <p>Nautobot's configuration file is <code>nautobot_config.py</code>.</p>
5060
5045
  <h5 id="initializing-a-config">Initializing a Config<a class="headerlink" href="#initializing-a-config" title="Permanent link">&para;</a></h5>
5061
5046
  <p>You may also initialize a new configuration using <code>nautobot-server init</code>:</p>
5062
- <div class="highlight"><pre><span></span><code><a id="__codelineno-32-1" name="__codelineno-32-1" href="#__codelineno-32-1"></a>nautobot-server init
5047
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-29-1" name="__codelineno-29-1" href="#__codelineno-29-1"></a>nautobot-server init
5063
5048
  </code></pre></div>
5064
5049
  <p>Example output:</p>
5065
- <div class="highlight"><pre><span></span><code><a id="__codelineno-33-1" name="__codelineno-33-1" href="#__codelineno-33-1"></a>Nautobot would like to send anonymized installation metrics to the project&#39;s maintainers.
5066
- <a id="__codelineno-33-2" name="__codelineno-33-2" href="#__codelineno-33-2"></a>These metrics include the installed Nautobot version, the Python version in use, an anonymous &quot;deployment ID&quot;, and a list of one-way-hashed names of enabled Nautobot Apps and their versions.
5067
- <a id="__codelineno-33-3" name="__codelineno-33-3" href="#__codelineno-33-3"></a>Allow Nautobot to send these metrics? [y/n]: n
5068
- <a id="__codelineno-33-4" name="__codelineno-33-4" href="#__codelineno-33-4"></a>Installation metrics will not be sent by default.
5069
- <a id="__codelineno-33-5" name="__codelineno-33-5" href="#__codelineno-33-5"></a>Configuration file created at /home/example/.nautobot/nautobot_config.py
5050
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-30-1" name="__codelineno-30-1" href="#__codelineno-30-1"></a>Nautobot would like to send anonymized installation metrics to the project&#39;s maintainers.
5051
+ <a id="__codelineno-30-2" name="__codelineno-30-2" href="#__codelineno-30-2"></a>These metrics include the installed Nautobot version, the Python version in use, an anonymous &quot;deployment ID&quot;, and a list of one-way-hashed names of enabled Nautobot Apps and their versions.
5052
+ <a id="__codelineno-30-3" name="__codelineno-30-3" href="#__codelineno-30-3"></a>Allow Nautobot to send these metrics? [y/n]: n
5053
+ <a id="__codelineno-30-4" name="__codelineno-30-4" href="#__codelineno-30-4"></a>Installation metrics will not be sent by default.
5054
+ <a id="__codelineno-30-5" name="__codelineno-30-5" href="#__codelineno-30-5"></a>Configuration file created at /home/example/.nautobot/nautobot_config.py
5070
5055
  </code></pre></div>
5071
5056
  <p>You may also specify alternate file locations. Please refer to <a href="../configuration/index.html">Configuring Nautobot</a> for how to do that.</p>
5072
5057
  <h5 id="using-the-development-config">Using the Development Config<a class="headerlink" href="#using-the-development-config" title="Permanent link">&para;</a></h5>
5073
5058
  <p>A <code>nautobot_config.py</code> suitable for development purposes can be found at <code>development/nautobot_config.py</code>. You may customize the values there or utilize environment variables to override the default values.</p>
5074
5059
  <p>If you want to use this file, initialize a config first, then copy this file to the default location Nautobot expects to find its config:</p>
5075
- <div class="highlight"><pre><span></span><code><a id="__codelineno-34-1" name="__codelineno-34-1" href="#__codelineno-34-1"></a>cp development/nautobot_config.py ~/.nautobot/nautobot_config.py
5060
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-31-1" name="__codelineno-31-1" href="#__codelineno-31-1"></a>cp development/nautobot_config.py ~/.nautobot/nautobot_config.py
5076
5061
  </code></pre></div>
5077
5062
  <h5 id="required-settings">Required Settings<a class="headerlink" href="#required-settings" title="Permanent link">&para;</a></h5>
5078
5063
  <p>A newly created configuration includes sane defaults. If you need to customize them, edit your <code>nautobot_config.py</code> and update the following settings as required:</p>
@@ -5085,6 +5070,32 @@
5085
5070
  </ul>
5086
5071
  <h2 id="working-in-your-development-environment">Working in your Development Environment<a class="headerlink" href="#working-in-your-development-environment" title="Permanent link">&para;</a></h2>
5087
5072
  <p>Below are common commands for working your development environment.</p>
5073
+ <h3 id="creating-a-branch">Creating a Branch<a class="headerlink" href="#creating-a-branch" title="Permanent link">&para;</a></h3>
5074
+ <p>Before you make any changes, always create a new branch. Again, for bug fixes and minor features, you'll want to create your branches from the <code>develop</code> branch, while for major new features, you'll branch from <code>next</code> instead.</p>
5075
+ <p>In current versions of Nautobot, you can use the <code>invoke branch</code> command to create a new branch or switch to an existing branch. Whether you're creating a branch off a fork or working against the Nautobot origin repo, you should follow this convention for naming your branch: <code>u/yourusername-0000-branch-summary</code>, where <code>0000</code> is the related GitHub issue number and <code>yourusername</code> is your GitHub username. (If you do not have a relevant GitHub issue, please consider opening one to document the context behind your changes.)</p>
5076
+ <p>For example:</p>
5077
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-32-1" name="__codelineno-32-1" href="#__codelineno-32-1"></a>invoke branch --create --branch u/yourusername-1234-some-bug-fix --parent develop
5078
+ </code></pre></div>
5079
+ <p>or:</p>
5080
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-33-1" name="__codelineno-33-1" href="#__codelineno-33-1"></a>invoke branch --create --branch u/yourusername-1235-amazing-feature --parent next
5081
+ </code></pre></div>
5082
+ <div class="admonition caution">
5083
+ <p class="admonition-title">Caution</p>
5084
+ <p>We recommend using this Invoke command instead of directly calling <code>git checkout</code> or <code>git switch</code> because it automatically handles some other aspects of the development environment, in particular stopping the currently running Nautobot Docker containers, if any, before switching to a different branch.</p>
5085
+ </div>
5086
+ <div class="admonition tip">
5087
+ <p class="admonition-title">Tip</p>
5088
+ <p>You can switch between any existing branches with simply <code>invoke branch --branch &lt;name&gt;</code>.</p>
5089
+ </div>
5090
+ <div class="admonition tip">
5091
+ <p class="admonition-title">Nautobot branches and the Docker compose workflow</p>
5092
+ <p>It's common for the Python dependencies and database schema to differ between major and minor Nautobot releases, and therefore between the primary branches of <code>main</code>, <code>develop</code>, <code>next</code>, and <code>ltm-1.6</code>. To account for this, the Docker workflow automatically detects which <code>major.minor</code> Nautobot version you're working with and changes the Docker Compose project name accordingly. What this means for you in practice is that when first switching between Nautobot releases, you may need to rerun <code>invoke build</code> once for each primary branch, and <code>invoke start</code>/<code>invoke debug</code> may take some time as it needs to create a new database and migrate its schema. However, in the future, switching between releasese should be relatively smooth (just <code>invoke branch -b &lt;name&gt;</code> and then <code>invoke start</code>) rather than needing to rebuild the container and database every time you switch between <code>develop</code> and <code>next</code> as would likely be needed if the same Docker Compose project name were used for both release trains.</p>
5093
+ <p>Conversely, if you're using the virtual environment workflow, you may need to manually run <code>poetry install</code> whenever switching between major branches, and may need to manually drop and restore the database schema as well. Be aware!</p>
5094
+ </div>
5095
+ <h4 id="prototypes">Prototypes<a class="headerlink" href="#prototypes" title="Permanent link">&para;</a></h4>
5096
+ <p>Sometimes code is written as a proof of concept or early implementation candidate but is not quite ready to be merged, or may be picked up by another author sometime in the future. In that case, the convention is to use the <code>prototype/</code> prefix to the branch name and not requiring the original authors username. In that scenario, using the example above, you would instead:</p>
5097
+ <div class="highlight"><pre><span></span><code><a id="__codelineno-34-1" name="__codelineno-34-1" href="#__codelineno-34-1"></a>invoke branch --create --branch prototype/1234-next-amazing-feature --parent next
5098
+ </code></pre></div>
5088
5099
  <h3 id="creating-a-superuser">Creating a Superuser<a class="headerlink" href="#creating-a-superuser" title="Permanent link">&para;</a></h3>
5089
5100
  <p>You'll need to create a administrative superuser account to be able to log into the Nautobot Web UI for the first time. Specifying an email address for the user is not required, but be sure to use a very strong password.</p>
5090
5101
  <table>