Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#32142 closed Bug (duplicate)

Tutorial 7 - [settings.py code error]

Reported by: Elijah Yang Owned by: nobody
Component: Documentation Version: 3.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In tutorial 7, https://docs.djangoproject.com/en/3.1/intro/tutorial07/

Under "Customizing your project’s templates",

'DIRS': [BASE_DIR / 'templates'],

should be

'DIRS': [BASE_DIR + '/templates'],

otherwise terminal will return an error.

Change History (3)

comment:1 Changed 3 years ago by Elijah Yang

Component: UncategorizedDocumentation
Type: UncategorizedBug

comment:2 Changed 3 years ago by Jacob Walls

Resolution: invalid
Status: newclosed

I'm afraid it's instead your suggestion that would raise an error at runtime -- BASE_DIR is a Path object, not a string, so the '/' operator is expected. After all, Windows and Unix-style OSes have different separators.

comment:3 Changed 3 years ago by Mariusz Felisiak

Resolution: invalidduplicate

Duplicate of #32115.

Note: See TracTickets for help on using tickets.
Back to Top