Django Views
Learn all about Django Views in this comprehensive tutorial.
- •Django views are Python functions that take http requests and return http response, like HTML documents.
Views
Django views are Python functions that take http requests and return http response, like HTML documents.
A web page that uses Django is full of views with different tasks and missions.
Views are usually put in a file called views.py located on your app's folder.
There is a views.py in your members folder that looks like this:
Find it and open it, and replace the content with this:
This is a simple example on how to send a response back to the browser.
But how can we execute the view? Well, we must call the view via a URL.
You will learn about URLs in the next chapter.
Module quiz
2 questionsWhich of the following is true about Django Views?
What is the most common pitfall when working with Django Views?
Answer all questions to submit.