#26028 closed New feature (fixed)
Improve instructions for overriding Django templates
Reported by: | Daniel Greenfeld | Owned by: | Philip James |
---|---|---|---|
Component: | Documentation | Version: | 1.9 |
Severity: | Normal | Keywords: | |
Cc: | berker.peksag@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
For dj-stripe, I get asked how to do this a lot. Rather than include instructions on how to do this in that third-party package, shouldn't this be improved in the core documentation?
Reference discussion: https://github.com/pydanny/dj-stripe/pull/254#issuecomment-168515982
Existing instructions on template overriding:
Change History (13)
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
Description: | modified (diff) |
---|
comment:4 by , 9 years ago
comment:5 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → New feature |
comment:6 by , 9 years ago
Description: | modified (diff) |
---|---|
Summary: | Improve instructions for overloading Django templates → Improve instructions for overriding Django templates |
comment:7 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
I'm very interested in making this better as I use this pattern all the time. Any tips on where this doc should live would be helpful, I'll also make a best guess in a PR soon, hopefully.
comment:9 by , 8 years ago
Cc: | added |
---|---|
Patch needs improvement: | set |
comment:10 by , 8 years ago
Patch needs improvement: | unset |
---|
comment:11 by , 8 years ago
Gentle ping: All the tests have passed, and I think the relevant feedback has been captured in the PR.
comment:12 by , 8 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
I just reviewed the last version the PR and it looks like all of my previous review comments have been addressed. I left two minor comments on GitHub, otherwise it looks pretty good to me. Thank you!
When I was researching how to customize third-party apps, I found this blog entry very useful for a rapid overview:
http://blog.yourlabs.org/post/19777151073/how-to-override-a-view-from-an-external-django-app
I also recently discovered this third-party app loader that allows one to extend templates, rather than replace them completely:
https://pypi.python.org/pypi/django-apptemplates/
From IRC discussions, it sounds like quite a few experienced people use forking for customization. It would be good to have clear guidelines about how to avoid forking , as well as guidelines on how to correctly do forking when you really have to.