[Django] #34157: Error on Tutorial 2nd page: mysite/settings.py | Code is incorrect

6 views
Skip to first unread message

Django

unread,
Nov 14, 2022, 11:20:08 AM11/14/22
to django-...@googlegroups.com
#34157: Error on Tutorial 2nd page: mysite/settings.py | Code is incorrect
-------------------------------------+-------------------------------------
Reporter: zenzenzen | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: | Version: 4.1
Documentation | Keywords: tutorial,
Severity: Normal | documentation, instructions,
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
In the Database portion of the tutorial:
[https://docs.djangoproject.com/en/4.1/intro/tutorial02/#activating-
models], The included code to copy produces an error.
"polls.apps.PollsConfig" at the top of the list does not work and returns
and error. But when "polls.apps.PollsConfig" is moved to the bottom of the
list, the makemigration polls command works as intended.

Correct code for users to copy:
{{{
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
**'polls.apps.PollsConfig'**
]
}}}

Incorrect Code to copy:

{{{
INSTALLED_APPS = [
**'polls.apps.PollsConfig'**
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
]
}}}

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

Django

unread,
Nov 14, 2022, 1:21:09 PM11/14/22
to django-...@googlegroups.com
#34157: Error on Tutorial 2nd page: mysite/settings.py | Code is incorrect
-------------------------------------+-------------------------------------
Reporter: Johnson Deng | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 4.1
Severity: Normal | Resolution: invalid
Keywords: tutorial, | Triage Stage:
documentation, instructions, | 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: new => closed
* resolution: => invalid


Comment:

What's the error? I think it's more likely that you made a mistake
somewhere. In this ticket description, there's no comma after
`'polls.apps.PollsConfig'` like there should be, so maybe that's it.

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

Reply all
Reply to author
Forward
0 new messages