diff options
| author | Tim Graham <timograham@gmail.com> | 2013-02-07 05:51:25 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-02-07 07:05:36 -0500 |
| commit | aa85ccf8ce11c4b8374c74fd9dfe72647be49ada (patch) | |
| tree | 4e68ef43ea9f82b93b23acf5267e35c18c2c6fce /docs/intro/tutorial02.txt | |
| parent | 43efefae692729925c0f75c55e93bd1f33f42bfd (diff) | |
Fixed #19706 - Tweaks to the tutorial.
Thanks Daniele Procida.
Diffstat (limited to 'docs/intro/tutorial02.txt')
| -rw-r--r-- | docs/intro/tutorial02.txt | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/docs/intro/tutorial02.txt b/docs/intro/tutorial02.txt index e5350a4d4c..966921f8a5 100644 --- a/docs/intro/tutorial02.txt +++ b/docs/intro/tutorial02.txt @@ -399,6 +399,11 @@ That's easy to change, though, using Django's template system. The Django admin is powered by Django itself, and its interfaces use Django's own template system. +.. _ref-customizing-your-projects-templates: + +Customizing your *project's* templates +-------------------------------------- + Create a ``mytemplates`` directory in your project directory. Templates can live anywhere on your filesystem that Django can access. (Django runs as whatever user your server runs.) However, keeping your templates within the @@ -446,11 +451,24 @@ override a template, just do the same thing you did with ``base_site.html`` -- copy it from the default directory into your custom directory, and make changes. +Customizing your *application's* templates +------------------------------------------ + Astute readers will ask: But if :setting:`TEMPLATE_DIRS` was empty by default, how was Django finding the default admin templates? The answer is that, by default, Django automatically looks for a ``templates/`` subdirectory within -each app package, for use as a fallback. See the :ref:`template loader -documentation <template-loaders>` for full information. +each application package, for use as a fallback (don't forget that +``django.contrib.admin`` is an application). + +Our poll application is not very complex and doesn't need custom admin +templates. But if it grew more sophisticated and required modification of +Django's standard admin templates for some of its functionality, it would be +more sensible to modify the *application's* templates, rather than those in the +*project*. That way, you could include the polls application in any new project +and be assured that it would find the custom templates it needed. + +See the :ref:`template loader documentation <template-loaders>` for more +information about how Django finds its templates. Customize the admin index page ============================== |
