Recall & Review
beginner
What is a request in Django?
A request is an object that Django receives from a user’s browser. It contains all the information about what the user wants, like the URL, form data, and headers.
Click to reveal answer
beginner
What does Django use to send data back to the user?
Django sends a response object back to the user’s browser. This response contains the content to display, like HTML, JSON, or a redirect.
Click to reveal answer
intermediate
How does Django handle a request internally?
Django takes the request, matches its URL to a view function, runs that function, and then returns the response generated by the view.
Click to reveal answer
intermediate
What is the role of middleware in processing requests and responses?
Middleware is code that runs before and after the view. It can modify the request before it reaches the view or change the response before it goes back to the user.
Click to reveal answer
beginner
What is the difference between
request.GET and request.POST?request.GET holds data sent in the URL query string, usually from links or forms with method GET. request.POST holds data sent in the body of a POST request, usually from forms that submit data.Click to reveal answer
What does Django use to decide which code runs for a request?
✗ Incorrect
Django uses URL routing to match the request URL to the correct view function.
Which object contains the data sent by the user in a form submission?
✗ Incorrect
request.POST contains form data sent via POST method.What can middleware do in Django?
✗ Incorrect
Middleware can modify both the request before the view and the response after the view.
What type of object does a Django view return?
✗ Incorrect
A Django view returns a response object that is sent back to the user.
Where does Django store HTTP headers from the request?
✗ Incorrect
HTTP headers are stored in
request.META as a dictionary.Explain the journey of a user request through Django until a response is sent back.
Think about what happens from when you type a URL to when you see a page.
You got /5 concepts.
Describe how you can access form data sent by a user in Django.
Consider the HTTP methods and where data is stored in the request object.
You got /4 concepts.