[Django] #29990: Error in part 7 of the tutorial

3 views
Skip to first unread message

Django

unread,
Nov 27, 2018, 8:45:10 AM11/27/18
to django-...@googlegroups.com
#29990: Error in part 7 of the tutorial
-----------------------------------------+-------------------------------
Reporter: sdabhi23 | Owner: sdabhi23
Type: Bug | Status: assigned
Component: Documentation | Version: 2.1
Severity: Normal | Keywords: documentation
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-----------------------------------------+-------------------------------
The code given at https://docs.djangoproject.com/en/2.1/intro/tutorial07
/#customizing-your-project-s-templates is incorrect and misleading as the
BASE_DIR variable points to the root of the main project directory as we
can see from the code snipppet:

{{{
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# BASE_DIR points to: ...\mysite\
# The tutorial assumes that it points to: ...\mysite\mysite
}}}

Hence the code in question should be changed to:

{{{
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(os.path.join(BASE_DIR, 'basic'),
'templates')], #This line has been changed
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29990>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 27, 2018, 9:03:00 AM11/27/18
to django-...@googlegroups.com
#29990: Error in part 7 of the tutorial
-------------------------------+--------------------------------------
Reporter: sdabhi23 | Owner: sdabhi23
Type: Bug | Status: closed
Component: Documentation | Version: 2.1
Severity: Normal | Resolution: invalid

Keywords: documentation | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tim Graham):

* status: assigned => closed
* resolution: => invalid


Comment:

I think you made a mistake. The instructions say, "Create a `templates`
directory in your project directory (the one that contains `manage.py`)".
I'm not sure where the 'basic' directory in your suggestion comes from.

--
Ticket URL: <https://code.djangoproject.com/ticket/29990#comment:1>

Django

unread,
Nov 29, 2018, 7:24:32 AM11/29/18
to django-...@googlegroups.com
#29990: Error in part 7 of the tutorial
-------------------------------+--------------------------------------
Reporter: Shrey | Owner: Shrey
Type: Bug | Status: closed
Component: Documentation | Version: 2.1
Severity: Normal | Resolution: invalid

Keywords: documentation | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Shrey):

Yep. Now I see that it was a mistake made by me. And if the docs were to
be updated the name mysite would be used instead of basic.

--
Ticket URL: <https://code.djangoproject.com/ticket/29990#comment:2>

Reply all
Reply to author
Forward
0 new messages