#20407 closed Bug (wontfix)
use of touple instead of list in settings.configure explanation
Reported by: | 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 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 12 years ago
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 by , 12 years ago
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 by , 12 years ago
Well, My bad, I used only a single dir and didn't add a ',' after it to make it a tuple.
Sorry!
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.