Code

Ticket #12811: 12811_tutorial_patch.diff

File 12811_tutorial_patch.diff, 1.6 KB (added by gabrielhurley, 4 years ago)

Clarifies tutorial language and removes premature instructions on templating.

Line 
1Index: docs/intro/tutorial02.txt
2===================================================================
3--- docs/intro/tutorial02.txt   (revision 12678)
4+++ docs/intro/tutorial02.txt   (working copy)
5@@ -447,12 +447,17 @@
6 make significant changes to the layout. After all, the index is probably the
7 most important page of the admin, and it should be easy to use.
8 
9-The template to customize is ``admin/index.html``. (Do the same as with
10-``admin/base_site.html`` in the previous section -- copy it from the default
11-directory to your custom template directory.) Edit the file, and you'll see it
12-uses a template variable called ``app_list``. That variable contains every
13-installed Django app. Instead of using that, you can hard-code links to
14-object-specific admin pages in whatever way you think is best.
15+The template to customize is ``admin/index.html``. As with
16+``admin/base_site.html`` in the previous section you don't want to edit the
17+original file. Instead, copy it from the default directory to your custom
18+template directory, then edit the copy.
19 
20+In that file, you'll see a reference to ``{% for app in app_list %}``. This is
21+Django's way of iterating over a variable named ``app_list`` which contains
22+every Django app in :setting:`INSTALLED_APPS`. The index page is normally
23+created by iterating through those apps and creating sections for each one
24+automatically. You can override this behavior using Django's templating
25+language, but we'll talk more about that in the next tutorial.
26+
27 When you're comfortable with the admin site, read :ref:`part 3 of this tutorial
28 <intro-tutorial03>` to start working on public poll views.