Django DetailView example

the model that we want to make a page for each query dynamically

class test(models.Model):
    firstname = models.CharField(max_length=300)
    last_name = models.CharField(max_length=300)
class test_detail(DetailView):
    model = test # model
    template_name = 'test.html' # template path
    slug_field = 'firstname' # slug field
path('<slug:slug>/', test_detail.as_view(), name='test_detail'), #slug = slug field


<!DOCTYPE html>
<h1>hello {{object.firstname}} !</h1>

We have added some quries in the "test" model


English today is not an art to be mastered it's just a tool to use to get a result