Since the output of this report is a line chart, we start by defining a Django app for that purpose. The app is located in the /path/to/repo/www/chapter_09/trends folder. We then add a reference to /path/to/repo/www/chapter_09/booksomeplace_dj/urls.py, such that the /trends/future URL points to the new Django app. In the same file, urls.py, we add another route for a view method that responds to an AJAX request, /trends/json:
from django.urls import path
from . import views
urlpatterns = [
path('future/', views.future, name='trends.future'),
path('future/json/', views.futureJson, name='trends.future_json'),
]
Let's now define a form to capture query parameters.