Good Code
The good version makes the fixed settings route win before the broad profile route can capture the same path segment.
Lesson 01
Put specific URL patterns before broad dynamic patterns so Django routes requests to the intended view.
from django.urls import path
from . import views
app_name = "reviews"
urlpatterns = [
path("settings/", views.review_settings, name="settings"),
path("<slug:username>/", views.reviewer_profile, name="profile"),
]from django.urls import path
from . import views
app_name = "reviews"
urlpatterns = [
path("<slug:username>/", views.reviewer_profile, name="profile"),
path("settings/", views.review_settings, name="settings"),
]The good version makes the fixed settings route win before the broad profile route can capture the same path segment.
The bad version makes settings/ look like a username. The view might run with the wrong assumptions, and the route table becomes harder to scan.