Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#31715 closed Bug (invalid)

Documentation : Customize the admin look and feel

Reported by: AbelardoLG 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

To Customizing your project’s templates, you wrote this line:

TEMPLATES = [ {

'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [BASE_DIR / 'templates'],

...

When I saved this modification, the server showed the attached log.

Attachments (1)

Captura de pantalla de 2020-06-16 16-09-50.png (135.0 KB ) - added by AbelardoLG 4 years ago.
Python's server outputs a log about this error

Download all attachments as: .zip

Change History (3)

by AbelardoLG, 4 years ago

Python's server outputs a log about this error

comment:1 by Carlton Gibson, 4 years ago

Resolution: invalid
Status: newclosed

This looks like BASE_DIR is a string, when you can only use / with Path objects.

Either use a Path object or os.path.join() to join (string) path segments correctly. (You can concatenate with + '/' + like normal strings, but that not OS independent, and likely error prone.)

Please see TicketClosingReasons/UseSupportChannels if you need more help.

comment:2 by Carlton Gibson, 4 years ago

The instructions should work if you're using a project created with the same version of Django as the docs you're reading.

The tutorial was updated in 26554cf5d1e96db10d0d5f4b69683a22fb82fdf8 which will be/was in 3.1 — in general full pathlib support isn't available until then. See #29983.

Last edited 4 years ago by Carlton Gibson (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top