[1.5.x] Changed "mysite/mytemplates/" -> "mysite/templates" in tutorial.
Thanks James Pic.
Backport of 1b7fb29dfb
from master.
This commit is contained in:
parent
e69d810741
commit
5732f7b62b
|
@ -74,11 +74,11 @@ After the previous tutorials, our project should look like this::
|
||||||
results.html
|
results.html
|
||||||
urls.py
|
urls.py
|
||||||
views.py
|
views.py
|
||||||
mytemplates/
|
templates/
|
||||||
admin/
|
admin/
|
||||||
base_site.html
|
base_site.html
|
||||||
|
|
||||||
You created ``mysite/mytemplates`` in :doc:`Tutorial 2 </intro/tutorial02>`,
|
You created ``mysite/templates`` in :doc:`Tutorial 2 </intro/tutorial02>`,
|
||||||
and ``polls/templates`` in :doc:`Tutorial 3 </intro/tutorial03>`. Now perhaps
|
and ``polls/templates`` in :doc:`Tutorial 3 </intro/tutorial03>`. Now perhaps
|
||||||
it is clearer why we chose to have separate template directories for the
|
it is clearer why we chose to have separate template directories for the
|
||||||
project and application: everything that is part of the polls application is in
|
project and application: everything that is part of the polls application is in
|
||||||
|
|
|
@ -440,7 +440,7 @@ system.
|
||||||
Customizing your *project's* templates
|
Customizing your *project's* templates
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
|
|
||||||
Create a ``mytemplates`` directory in your project directory. Templates can
|
Create a ``templates`` directory in your project directory. Templates can
|
||||||
live anywhere on your filesystem that Django can access. (Django runs as
|
live anywhere on your filesystem that Django can access. (Django runs as
|
||||||
whatever user your server runs.) However, keeping your templates within the
|
whatever user your server runs.) However, keeping your templates within the
|
||||||
project is a good convention to follow.
|
project is a good convention to follow.
|
||||||
|
@ -449,16 +449,16 @@ By default, :setting:`TEMPLATE_DIRS` is empty. So, let's add a line to it, to
|
||||||
tell Django where our templates live::
|
tell Django where our templates live::
|
||||||
|
|
||||||
TEMPLATE_DIRS = (
|
TEMPLATE_DIRS = (
|
||||||
'/path/to/mysite/mytemplates', # Change this to your own directory.
|
'/path/to/mysite/templates', # Change this to your own directory.
|
||||||
)
|
)
|
||||||
|
|
||||||
Now copy the template ``admin/base_site.html`` from within the default Django
|
Now copy the template ``admin/base_site.html`` from within the default Django
|
||||||
admin template directory in the source code of Django itself
|
admin template directory in the source code of Django itself
|
||||||
(``django/contrib/admin/templates``) into an ``admin`` subdirectory of
|
(``django/contrib/admin/templates``) into an ``admin`` subdirectory of
|
||||||
whichever directory you're using in :setting:`TEMPLATE_DIRS`. For example, if
|
whichever directory you're using in :setting:`TEMPLATE_DIRS`. For example, if
|
||||||
your :setting:`TEMPLATE_DIRS` includes ``'/path/to/mysite/mytemplates'``, as
|
your :setting:`TEMPLATE_DIRS` includes ``'/path/to/mysite/templates'``, as
|
||||||
above, then copy ``django/contrib/admin/templates/admin/base_site.html`` to
|
above, then copy ``django/contrib/admin/templates/admin/base_site.html`` to
|
||||||
``/path/to/mysite/mytemplates/admin/base_site.html``. Don't forget that
|
``/path/to/mysite/templates/admin/base_site.html``. Don't forget that
|
||||||
``admin`` subdirectory.
|
``admin`` subdirectory.
|
||||||
|
|
||||||
.. admonition:: Where are the Django source files?
|
.. admonition:: Where are the Django source files?
|
||||||
|
|
|
@ -300,7 +300,7 @@ Django knows to find the polls templates even though we didn't modify
|
||||||
and it would work perfectly well. However, this template belongs to the
|
and it would work perfectly well. However, this template belongs to the
|
||||||
polls application, so unlike the admin template we created in the previous
|
polls application, so unlike the admin template we created in the previous
|
||||||
tutorial, we'll put this one in the application's template directory
|
tutorial, we'll put this one in the application's template directory
|
||||||
(``polls/templates``) rather than the project's (``mytemplates``). We'll
|
(``polls/templates``) rather than the project's (``templates``). We'll
|
||||||
discuss in more detail in the :doc:`reusable apps tutorial
|
discuss in more detail in the :doc:`reusable apps tutorial
|
||||||
</intro/reusable-apps>` *why* we do this.
|
</intro/reusable-apps>` *why* we do this.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue