Opened 5 years ago

Closed 5 years ago

Last modified 5 years 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



I'm was trying to use Django templates and wanted to know how to configure the settings manually and I found this page:

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:

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

Change History (4)

comment:1 Changed 5 years ago by Tim Graham

Resolution: wontfix
Status: newclosed

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 5 years 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 5 years ago by Claude Paroz

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 5 years ago by anonymous

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

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