The main objective of this is to have a view mounted at the root so that when we deploy the site to heroku later, there's a page that appears instead of a blank page.
It might also help make the chapter 1 more concrete (showing the request/response cycle, how you map URLs to views, ...).
I would put it at the end of chapter 8, after the reader sees the default "It works" page that Django generates.
Something as simple as:
def say_hello(request):
return HttpResponse('Hello!')
The main objective of this is to have a view mounted at the root so that when we deploy the site to heroku later, there's a page that appears instead of a blank page.
It might also help make the chapter 1 more concrete (showing the request/response cycle, how you map URLs to views, ...).
I would put it at the end of chapter 8, after the reader sees the default "It works" page that Django generates.
Something as simple as: