Opened 22 months ago

Closed 22 months ago

Last modified 22 months ago

#20407 closed Bug (wontfix)

use of touple instead of list in settings.configure explanation

Reported by: amirwilf@… Owned by: nobody
Component: Documentation Version: 1.5
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

Hey,

I'm was trying to use Django templates and wanted to know how to configure the settings manually and I found this page:
https://docs.djangoproject.com/en/dev/topics/settings/

In "django.conf.settings.configure(default_settings, settings)", in the example it says to define:
"TEMPLATE_DIRS=('/home/web-apps/myapp', '/home/web-apps/base')"

from my tests and this page: http://www.djangobook.com/en/2.0/appendixD.html

it says to define:
"TEMPLATE_DIRS=['/home/web-apps/myapp', '/home/web-apps/base']"

Change History (4)

comment:1 Changed 22 months ago by timo

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

You may use either - tuples can't be changed (immutable) while lists can be; both are iterables. This is Python basics though, so I'm not sure it belongs in the Django docs.

comment:2 Changed 22 months ago by anonymous

I get what you're saying but on the other hand, when I tried using a tuple it couldn't find the template and when I used a list it did - I didn't go too deep into the code to understand why or if this only happened to me for some reason.

comment:3 Changed 22 months ago by claudep

Are you sure your tuple was a real tuple and not a mere string like ('/only/path/')? If you can reproduce it consistently, feel free to reopen.

comment:4 Changed 22 months ago by anonymous

Well, My bad, I used only a single dir and didn't add a ',' after it to make it a tuple.
Sorry!

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