Ticket #23491: 23491.diff

File 23491.diff, 1.1 KB (added by Tim Graham, 10 years ago)
  • docs/intro/tutorial03.txt

    diff --git a/docs/intro/tutorial03.txt b/docs/intro/tutorial03.txt
    index 54cc019..7b40062 100644
    a b you want, using whatever Python libraries you want.  
    287287All Django wants is that :class:`~django.http.HttpResponse`. Or an exception.
    288288
    289289Because it's convenient, let's use Django's own database API, which we covered
    290 in :doc:`Tutorial 1 </intro/tutorial01>`. Here's one stab at the ``index()``
     290in :doc:`Tutorial 1 </intro/tutorial01>`. Here's one stab at a new ``index()``
    291291view, which displays the latest 5 poll questions in the system, separated by
    292292commas, according to publication date:
    293293
    commas, according to publication date:  
    304304        output = ', '.join([p.question_text for p in latest_question_list])
    305305        return HttpResponse(output)
    306306
     307    # Leave the rest of the views (detail, results, vote) unchanged
     308
    307309There's a problem here, though: the page's design is hard-coded in the view. If
    308310you want to change the way the page looks, you'll have to edit this Python code.
    309311So let's use Django's template system to separate the design from Python by
Back to Top