Intro to Django Examples
We have five examples (six if you count this home page, index.html):
Hello World (no template) -- This is a most basic hello world example, that simply sends back an HttpResponse object containing the HTML we want to provide in the response.
Hello World with Template -- A very
basic example. The action (in views.py) immediately renders a templated
view with empty context. The view displays Hello World.
Greet Get -- This example checks for a name parameter
in the GET request. If present, it puts the name into the context and renders
a templated view which says hello to the name. If the parameter is not
present, displays a form to ask for the name.
Greet Post -- This example checks to see if the
GET or POST HTTP Method was used for the request. If GET was used, the
action (in views.py) displays a templated view to display a form to ask for a
name. If POST was used, the action gets the name parameter uses a different
templated view to say hello to the name.
Show -- This example displays interesting data
about the HTTP request that invokes it. It can be helpful for debugging
when you want to see what is getting sent to the server.