Your First View
A view is a Python function that takes a request and returns a response. Put it in views.py.
Example
# blog/views.py
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You are at the blog index.")Exercise
What does a view receive?
def index():
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.