In this recipe, we will create a list of links to the locations, which, when clicked, opens a Bootstrap modal dialog (we will call it a popup in this recipe) with some information about the location and the more... link leading to the location detail page. The content for the dialog will be loaded by Ajax. For visitors without JavaScript, the detail page will open immediately, without this intermediate step.
Opening object details in a modal dialog
Getting ready
Let's start with the locations app that we created in the previous recipes.
In the urls.py file, we will have three URL rules: one for the location list, another for the location detail, and a third for the dialog, as follows:
# locations/urls.py
from django.urls...