#25010 closed Cleanup/optimization (fixed)
TEMPLATES settings documentation is confusing about APP_DIRS
Reported by: | Daniel Quinn | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 1.8 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The documentation for the TEMPLATES
setting https://docs.djangoproject.com/en/1.8/ref/settings/#templates says that APP_DIR
defines whether or not Django should source templates from the templates
directory inside each app directory. In the simple example given, APP_DIR
is set to True
, which is a little weird because this is the default setup you get when you run startproject
.
However, further down in the same section, the default for APP_DIR
is defined as False
, so when I first read this, I thought that I needed to use the example snippet to turn on what was already the default behaviour. It's all very confusing.
To fix this, I think the best option would be to:
- Document that the default for
APP_DIR
is True (unless this isn't the case and I'm missing something) - Modify the example to do something other than the default behaviour. This part isn't necessary, but coupled with the above problem, none of this makes sense on first reading.
Attachments (1)
Change History (6)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Component: | Template system → Documentation |
---|---|
Has patch: | set |
Summary: | TEMPLATES settings documentation is either wrong or just confusing → TEMPLATES settings documentation is confusing about APP_DIRS |
Triage Stage: | Unreviewed → Accepted |
Type: | Bug → Cleanup/optimization |
Daniel, I've attached a patch. Let us know if you have any other suggestions besides that.
by , 10 years ago
Attachment: | 25010.diff added |
---|
comment:3 by , 10 years ago
I read your patch and I literally just said: "Oh!" This makes *so* much more sense now. Yes, I think this is probably sufficient.
The default for
APP_DIR
beingFalse
means that it will beFalse
if you don't specify it in your settings.However the settings that
startproject
creates sets it toTrue
because it's almost always is what you want.Whether it should be
True
orFalse
as default however, is up to discussion. But I think the reason for it beingFalse
is that you want sensible defaults that will always work.